keen/col/map

Source
This is a standard module and does not need to be explicitly imported.
map[k, v] record (has private fields)
Immutable unordered map type. Iteration is sorted, meaning it does O(n) work even if it only iterates one element. A map is logically a collection of key-value pairs ((k, v)). A key can appear at most once, and given a key, you can access the associated value in O(1).
==[k, v] bool(a v[k], b v[k]) k key, v equal
list-new[k, v] v[k](a (k, v)[]) k key
Later pairs overwrite earlier pairs with the same key.
named-new[v] v[symbol](keys symbol[], values v[])
Maps with symbol keys can be created using the named-new syntax.
to[k, v] v[k](a (k, v)[]) k key
Converts a list of pairs to a map. Later pairs overwrite earlier pairs with the same key.
to[k, v] v[k](a (k, v) array-view) k key
to[k, v] (k, v)[](a v[k]) k key
Returns all pairs in the map, sorted by key.
is-empty[k, v] bool(a v[k]) k key
true if a.size == 0
size[k, v] nat64(a v[k])
Number of pairs.
subscript[k, v] v option(a v[k], key k) k key
Gets the value associated with a key. Returns an empty option unless key in a.
~[k, v] v[k](a v[k], (key k, value v)) k key
Associates the key with the value. If key in a, overwrites the old value. Otherwise adds a new entry.
~~[k, v] v[k](a v[k], b v[k]) k key
Adds/updates many entries to a. Where keys match, values in b overwrite values in b. Otherwise they add new entries.
keys[k, v] k[](a v[k]) k key
values[k, v] v[](a v[k]) k key
-[k, v] v[k](a v[k], key k) k key
Removes key and its associated value. If key !in a, returns a unmodified. If you need the old value, use remove instead.
remove[k, v] (v, v[k]) option(a v[k], key k) k key

Removes a key and its associated value, and returns the value and the new map.

If key !in a, returns an empty option.

some[k, v] bool(a v[k], f bool mut((k, v))) k key
map-unsorted[k, v] record (has private fields)
unsorted[k, v] (k, v) map-unsorted(a v[k]) unsafe
size[k, v] nat64(a (k, v) map-unsorted)
some[k, v] bool(a (k, v) map-unsorted, f bool mut((k, v))) unsafe