map -package:base -is:exact -is:exact -package:text -package:blaze-html -package:bytestring package:unordered-containers -is:exact

Transform this map by applying a function to every value.
Transform this set by applying a function to every value. The resulting set may be smaller than the source.
>>> HashSet.map show (HashSet.fromList [1,2,3])
HashSet.fromList ["1","2","3"]
mapKeys f s is the map obtained by applying f to each key of s. The size of the result may be smaller if f maps two or more distinct keys to the same new key. In this case there is no guarantee which of the associated values is chosen for the conflicting key.
>>> mapKeys (+ 1) (fromList [(5,"a"), (3,"b")])
fromList [(4,"b"),(6,"a")]

>>> mapKeys (\ _ -> 1) (fromList [(1,"b"), (2,"a"), (3,"d"), (4,"c")])
fromList [(1,"c")]

>>> mapKeys (\ _ -> 3) (fromList [(1,"b"), (2,"a"), (3,"d"), (4,"c")])
fromList [(3,"c")]
Transform this map by applying a function to every value and retaining only some of them.
Transform this map by applying a function to every value and retaining only some of them.
Transform this map by applying a function to every value.
Strict version of map.
A bitmap as contained by a BitmapIndexed node, or a fullNodeMask corresponding to a Full node. Only the lower maxChildren bits are used. The remaining bits must be zeros.
A map from keys to values. A map cannot contain duplicate keys; each key can map to at most one value.
Create a BitmapIndexed or Full node.
Common implementation for filterWithKey and mapMaybeWithKey, allowing the former to former to reuse terms.
Reduce the map by applying a function to each element and combining the results with a monoid operation.
Inclusion of maps. A map is included in another map if the keys are subsets and the corresponding values are equal:
isSubmapOf m1 m2 = keys m1 `isSubsetOf` keys m2 &&
and [ v1 == v2 | (k1,v1) <- toList m1; let v2 = m2 ! k1 ]

Examples

>>> fromList [(1,'a')] `isSubmapOf` fromList [(1,'a'),(2,'b')]
True
>>> fromList [(1,'a'),(2,'b')] `isSubmapOf` fromList [(1,'a')]
False
Inclusion of maps with value comparison. A map is included in another map if the keys are subsets and if the comparison function is true for the corresponding values:
isSubmapOfBy cmpV m1 m2 = keys m1 `isSubsetOf` keys m2 &&
and [ v1 `cmpV` v2 | (k1,v1) <- toList m1; let v2 = m2 ! k1 ]

Examples

>>> isSubmapOfBy (<=) (fromList [(1,'a')]) (fromList [(1,'b'),(2,'c')])
True
>>> isSubmapOfBy (<=) (fromList [(1,'b')]) (fromList [(1,'a'),(2,'c')])
False
Convert from the equivalent HashMap with () values.
>>> HashSet.fromMap (HashMap.singleton 1 ())
fromList [1]
Convert to set to the equivalent HashMap with () values.
>>> HashSet.toMap (HashSet.singleton 1)
fromList [(1,())]