keen/col/map
SourceThis is a standard module
and does not need to be explicitly imported.
map[k, v] record (has private fields)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 keyConverts a list of pairs to a map. Later pairs overwrite earlier pairs with the same key.
subscript[k, v] v option(a v[k], key k) k keyGets 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 keyAssociates 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 keyAdds/updates many entries to
a. Where keys match, values in b overwrite values in b. Otherwise they add new entries.-[k, v] v[k](a v[k], key k) k keyRemoves
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 keyRemoves a key and its associated value, and returns the value and the new map.
If key !in a, returns an empty option.
map-unsorted[k, v] record (has private fields)
k,v)). A key can appear at most once, and given a key, you can access the associated value in O(1).