ghc-7.8.20140130: The GHC API

Safe HaskellNone
LanguageHaskell98

UniqFM

Contents

Synopsis

Unique-keyed mappings

Manipulating those mappings

unitUFM :: Uniquable key => key -> elt -> UniqFM eltSource

listToUFM :: Uniquable key => [(key, elt)] -> UniqFM eltSource

listToUFM_C :: Uniquable key => (elt -> elt -> elt) -> [(key, elt)] -> UniqFM eltSource

addToUFM :: Uniquable key => UniqFM elt -> key -> elt -> UniqFM eltSource

addToUFM_C :: Uniquable key => (elt -> elt -> elt) -> UniqFM elt -> key -> elt -> UniqFM eltSource

addToUFM_Acc :: Uniquable key => (elt -> elts -> elts) -> (elt -> elts) -> UniqFM elts -> key -> elt -> UniqFM eltsSource

addListToUFM :: Uniquable key => UniqFM elt -> [(key, elt)] -> UniqFM eltSource

addListToUFM_C :: Uniquable key => (elt -> elt -> elt) -> UniqFM elt -> [(key, elt)] -> UniqFM eltSource

adjustUFM :: Uniquable key => (elt -> elt) -> UniqFM elt -> key -> UniqFM eltSource

alterUFM :: Uniquable key => (Maybe elt -> Maybe elt) -> UniqFM elt -> key -> UniqFM eltSource

adjustUFM_Directly :: (elt -> elt) -> UniqFM elt -> Unique -> UniqFM eltSource

delFromUFM :: Uniquable key => UniqFM elt -> key -> UniqFM eltSource

delListFromUFM :: Uniquable key => UniqFM elt -> [key] -> UniqFM eltSource

plusUFM :: UniqFM elt -> UniqFM elt -> UniqFM eltSource

plusUFM_C :: (elt -> elt -> elt) -> UniqFM elt -> UniqFM elt -> UniqFM eltSource

plusUFM_CD :: (elt -> elt -> elt) -> UniqFM elt -> elt -> UniqFM elt -> elt -> UniqFM eltSource

`plusUFM_CD f m1 d1 m2 d2` merges the maps using f as the combinding function and d1 resp. d2 as the default value if there is no entry in m1 reps. m2. The domain is the union of the domains of m1 and m2.

Representative example:

 plusUFM_CD f {A: 1, B: 2} 23 {B: 3, C: 4} 42
    == {A: f 1 42, B: f 2 3, C: f 23 4 }
 

minusUFM :: UniqFM elt1 -> UniqFM elt2 -> UniqFM elt1Source

intersectUFM :: UniqFM elt -> UniqFM elt -> UniqFM eltSource

intersectUFM_C :: (elt1 -> elt2 -> elt3) -> UniqFM elt1 -> UniqFM elt2 -> UniqFM elt3Source

foldUFM :: (elt -> a -> a) -> a -> UniqFM elt -> aSource

foldUFM_Directly :: (Unique -> elt -> a -> a) -> a -> UniqFM elt -> aSource

mapUFM :: (elt1 -> elt2) -> UniqFM elt1 -> UniqFM elt2Source

mapUFM_Directly :: (Unique -> elt1 -> elt2) -> UniqFM elt1 -> UniqFM elt2Source

elemUFM :: Uniquable key => key -> UniqFM elt -> BoolSource

filterUFM :: (elt -> Bool) -> UniqFM elt -> UniqFM eltSource

filterUFM_Directly :: (Unique -> elt -> Bool) -> UniqFM elt -> UniqFM eltSource

partitionUFM :: (elt -> Bool) -> UniqFM elt -> (UniqFM elt, UniqFM elt)Source

lookupUFM :: Uniquable key => UniqFM elt -> key -> Maybe eltSource

lookupWithDefaultUFM :: Uniquable key => UniqFM elt -> elt -> key -> eltSource

eltsUFM :: UniqFM elt -> [elt]Source

splitUFM :: Uniquable key => UniqFM elt -> key -> (UniqFM elt, Maybe elt, UniqFM elt)Source

ufmToList :: UniqFM elt -> [(Unique, elt)]Source