Skip to main content

Module hash_map

Module hash_map 

Source
Expand description

HashMap<K, V>, whose model is what it holds and the shape its order depends on.

Nothing here may let two maps that Lean takes for one value behave differently. So every empty map has the same hash keys, and to_array, keys and values list in the one order the map has, which a clone keeps. An operation that changes nothing, such as erasing a key that is not there, is still done on a map of the holder’s own: what the order of later listings depends on can change even then.

Functions§

all
any
contains
empty
erase
filter
fold
The entries come in the order to_array lists them, which is the order of the model.
get
get_or
What key is mapped to, or fallback, which is copied only if it is the answer.
insert
keys
size
to_array
values