Skip to main content

interface VariantMap<K,V>

A type-variant immutable Map of key type K, and value type V. In the Map, each key has exactly one value, and the Map cannot contain duplicate keys. See the Map documentation and the VariantMap API documentation

Companion namespace: VariantMap

Implemented by: VariantMap.NonEmpty<K,V>

Type parameters

NameDescription
Kthe key type
Vthe value type
note

Type-variance means that both the key and value types can be widened in a type-safe way without casting. @note As a consequence of being variant, the type does not contain methods that (can) add new elements to the collection.