Map - A
Map is an associative array data type composed of a
collection of key/value pairs such that each possible key appears
at most once in the collection.
A class for types that can be used as keys for the
Maptype. All keys
keyFromText (keyToText k) == k.
: Text -> k
Recover a key from its textual representation.
keyFromText xis allowed to fail whenever there is no key
keyToText k == x. Whenever such a
kdoes exist, then it must satisfy
keyFromText x == k.
data Map k v
Map k vis an associative array data type composed of a collection of key/value pairs of key type
kand value type
vsuch that each possible key appears at most once in the collection.
Create a map from a list of key/value pairs with a combining function. Examples:
fromListWith (<>) [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5,"c")] == fromList [(3, "ba"), (5, "abc")] fromListWith (<>)  == (empty : Map Int Text)
Convert the map to a list of key/value pairs where the keys are in ascending order of their textual representation.
Mapusing a predicate: keep only the entries where the value satisfies the predicate.
Mapusing a predicate: keep only the entries which satisfy the predicate.
Delete a key and its value from the map. When the key is not a member of the map, the original map is returned.
Insert a new key/value pair in the map. If the key is already present in the map, the associated value is replaced with the supplied value.
The union of two maps, preferring the first map when equal keys are encountered.
Merge two maps.
merge f g h x yapplies
fto all key/value pairs whose key only appears in
gto all pairs whose key only appears in
hto all pairs whose key appears in both
y. In the end, all pairs yielding
Someare collected as the result.