|
|
|
|
|
|
Synopsis |
|
|
|
|
Mappings keyed from arbitrary types
|
|
data FiniteMap key elt |
A finite mapping from (orderable) key types to elements
| Instances | |
|
|
Manipulating those mappings
|
|
emptyFM :: FiniteMap key elt |
|
unitFM :: key -> elt -> FiniteMap key elt |
|
listToFM :: Ord key => [(key, elt)] -> FiniteMap key elt |
In the case of duplicates keys, the last item is taken
|
|
addToFM :: Ord key => FiniteMap key elt -> key -> elt -> FiniteMap key elt |
Throws away any previous binding
|
|
addToFM_C :: Ord key => (elt -> elt -> elt) -> FiniteMap key elt -> key -> elt -> FiniteMap key elt |
Combines added item with previous item, if any
|
|
addListToFM :: Ord key => FiniteMap key elt -> [(key, elt)] -> FiniteMap key elt |
Throws away any previous binding, items are added left-to-right
|
|
addListToFM_C :: Ord key => (elt -> elt -> elt) -> FiniteMap key elt -> [(key, elt)] -> FiniteMap key elt |
Combines added item with previous item, if any, items are added left-to-right
|
|
delFromFM :: Ord key => FiniteMap key elt -> key -> FiniteMap key elt |
Deletion doesn't complain if you try to delete something which isn't there
|
|
delListFromFM :: Ord key => FiniteMap key elt -> [key] -> FiniteMap key elt |
Deletion doesn't complain if you try to delete something which isn't there
|
|
plusFM :: Ord key => FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt |
Bindings in right argument shadow those in the left
|
|
plusFM_C :: Ord key => (elt -> elt -> elt) -> FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt |
Combines bindings for the same thing with the given function,
bindings in right argument shadow those in the left
|
|
minusFM :: Ord key => FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt |
Deletes from the left argument any bindings in the right argument
|
|
foldFM :: (key -> elt -> a -> a) -> a -> FiniteMap key elt -> a |
|
intersectFM :: Ord key => FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt |
|
intersectFM_C :: Ord key => (elt1 -> elt2 -> elt3) -> FiniteMap key elt1 -> FiniteMap key elt2 -> FiniteMap key elt3 |
Combines bindings for the same thing in the two maps with the given function
|
|
mapFM :: (key -> elt1 -> elt2) -> FiniteMap key elt1 -> FiniteMap key elt2 |
|
filterFM :: Ord key => (key -> elt -> Bool) -> FiniteMap key elt -> FiniteMap key elt |
|
sizeFM :: FiniteMap key elt -> Int |
|
isEmptyFM :: FiniteMap key elt -> Bool |
|
elemFM :: Ord key => key -> FiniteMap key elt -> Bool |
|
lookupFM :: Ord key => FiniteMap key elt -> key -> Maybe elt |
|
lookupWithDefaultFM :: Ord key => FiniteMap key elt -> elt -> key -> elt |
Supplies a default element in return for an unmapped key
|
|
fmToList :: FiniteMap key elt -> [(key, elt)] |
|
keysFM :: FiniteMap key elt -> [key] |
|
eltsFM :: FiniteMap key elt -> [elt] |
|
bagToFM :: Ord key => Bag (key, elt) -> FiniteMap key elt |
In the case of duplicate keys, who knows which item is taken
|
|
Produced by Haddock version 2.4.2 |