keen/col/mut-sorted-map
Sourcemut-sorted-map[k, v] record (has private fields)list-new[k, v] (k, v) mut-sorted-map(a (k, v)[]) k sorted-keyLater pairs overwrite earlier pairs with the same key.
subscript[k, v] v option(a (k, v) mut-sorted-map, key k) k sorted-keyFind the value associated with the key. Returns an empty option iff the key is not in the map. This is O(
a.size log).set-subscript[k, v] void(a (k, v) mut-sorted-map, key k, value v) k sorted-keyAdds a key-value pair, replacing any existing one with that key.
~~=[k, v] void(a (k, v) mut-sorted-map, b (k, v)[]) k sorted-keyAdds many key-value pairs, replacing existing ones with the same keys. Equivalent to adding each element of
b separately.remove-key[k, v] v option(a (k, v) mut-sorted-map, key k) k sorted-keyIf the key is in the map, removes it and returns the value that was associated with it. Else, returns an empty option.
mut v[k], but iterates in sorted order.