Add a key-value pair to a map. If the given key already exists, update the corresponding value. The time complexity is O(log size).
Check whether a map contains a key. The time complexity is O(log size).
Create an empty map.
Iterate over key-value pairs in ascending order of their keys.
Iterate over keys in ascending order.
Get the value of a specified key. The time complexity is O(log size).
Check whether a map is empty.
Return the key-value pair of the largest key in a map. The time complexity is O(log size).
Return the key-value pair of the smallest key in a map. The time complexity is O(log size).
Remove a key and the corresponding value from a map. Do nothing if the given key does not exist. The time complexity is O(log size).
Return the number of key-value pairs. The time complexity is O(1).
Update the key-value pair of a specified key.
If key
already exists, replace the corresponding value v
with f(Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(v))
.
Otherwise, add the pair of key
and f(Nothingstd/core/types/Nothing: forall<a> maybe<a>)
.
The time complexity is O(log size).
Map
.