Definitions
insertWith {Key Value} {{Ord Key}} (fun : Value -> Value -> Value) (key : Key) (value : Value) (map : Map Key Value) : Map Key ValueSource#
insert {Key Value : Type} {{Ord Key}} (key : Key) (elem : Value) (map : Map Key Value) : Map Key ValueSource#
𝒪(log 𝓃). Inserts a new `key` and `value` into `map`. If `key` is already present in `map`, the associated value is replaced with the supplied `value`.
lookup {Key Value} {{Ord Key}} (key : Key) (map : Map Key Value) : Maybe ValueSource#
𝒪(log 𝓃). Queries whether a given `key` is in `map`.
isMember {Key Value} {{Ord Key}} (key : Key) (map : Map Key Value) : BoolSource#
𝒪(log 𝓃). Queries whether a given `key` is in `map`.
fromListWithKey {Key Value} {{Ord Key}} (fun : Key -> Value -> Value -> Value) (list : List (Pair Key Value)) : Map Key ValueSource#
fromListWith {Key Value} {{Ord Key}} (fun : Value -> Value -> Value) (list : List (Pair Key Value)) : Map Key ValueSource#
delete {Key Value} {{Ord Key}} (key : Key) (map : Map Key Value) : Map Key ValueSource#
𝒪(log 𝓃). Removes `key` assignment from `map`.
mapValuesWithKey {Key Value1 Value2} (fun : Key -> Value1 -> Value2) (map : Map Key Value1) : Map Key Value2Source#
mapValues {Key Value1 Value2} (fun : Value1 -> Value2) (map : Map Key Value1) : Map Key Value2Source#
foldr {Key Value Acc} (fun : Key -> Value -> Acc -> Acc) (acc : Acc) (map : Map Key Value) : AccSource#
foldl {Key Value Acc} (fun : Acc -> Key -> Value -> Acc) (acc : Acc) (map : Map Key Value) : AccSource#
intersection {Key Value} {{Ord Key}} (map1 map2 : Map Key Value) : Map Key ValueSource#
𝒪(n log n). Intersection of two maps. Returns data in the first map for the keys existing in both maps.
difference {Key Value} {{Ord Key}} (map1 map2 : Map Key Value) : Map Key ValueSource#
𝒪(n log n). Return elements of `map1` with keys not existing in `map2`.
unionLeft {Key Value} {{Ord Key}} (map1 map2 : Map Key Value) : Map Key ValueSource#
𝒪(n log n). Returns a Map containing the elements that are in `map1` or `map2`. This is a left-biased union of `map1` and `map2` which prefers `map1` when duplicate keys are encountered.
union {Key Value} {{Ord Key}} (map1 map2 : Map Key Value) : Map Key ValueSource#
𝒪(n log n). Returns a Map containing the elements that are in `map1` or `map2`.
unions {Key Value Container} {{Ord Key}} {{Foldable Container (Map Key Value)}} (maps : Container) : Map Key ValueSource#
disjointUnion {Key Value} {{Ord Key}} (map1 map2 : Map Key Value) : Result Key (Map Key Value)Source#
O(n log n). If `map1` and `map2` are disjoint (have no common keys), then returns `ok map` where `map` is the union of `map1` and `map2`. If `map1` and `map2` are not disjoint, then returns `error k` where `k` is a common key.
all {Key Value} (predicate : Key -> Value -> Bool) (map : Map Key Value) : BoolSource#
𝒪(𝓃). Returns true if all key-value pairs in `map` satisfy `predicate`.
any {Key Value} (predicate : Key -> Value -> Bool) (map : Map Key Value) : BoolSource#
𝒪(𝓃). Returns true if some key-value pair in `map` satisfies `predicate`.
filter {Key Value} {{Ord Key}} (predicate : Key -> Value -> Bool) (map : Map Key Value) : Map Key ValueSource#
𝒪(n log n). Returns a Map containing all key-value pairs of `map` that satisfy `predicate`.