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