ghc-8.2.2: The GHC API

Safe Haskell | None
Language | Haskell2010

UniqDFM

Contents

- Unique-keyed deterministic mappings
  - Manipulating those mappings

Synopsis

- data UniqDFM ele
- emptyUDFM :: UniqDFM elt
- unitUDFM :: Uniquable key => key -> elt -> UniqDFM elt
- addToUDFM :: Uniquable key => UniqDFM elt -> key -> elt -> UniqDFM elt
- addToUDFM_C :: Uniquable key => (elt -> elt -> elt) -> UniqDFM elt -> key -> elt -> UniqDFM elt
- addListToUDFM :: Uniquable key => UniqDFM elt -> [(key, elt)] -> UniqDFM elt
- delFromUDFM :: Uniquable key => UniqDFM elt -> key -> UniqDFM elt
- delListFromUDFM :: Uniquable key => UniqDFM elt -> [key] -> UniqDFM elt
- adjustUDFM :: Uniquable key => (elt -> elt) -> UniqDFM elt -> key -> UniqDFM elt
- alterUDFM :: Uniquable key => (Maybe elt -> Maybe elt) -> UniqDFM elt -> key -> UniqDFM elt
- mapUDFM :: (elt1 -> elt2) -> UniqDFM elt1 -> UniqDFM elt2
- plusUDFM :: UniqDFM elt -> UniqDFM elt -> UniqDFM elt
- plusUDFM_C :: (elt -> elt -> elt) -> UniqDFM elt -> UniqDFM elt -> UniqDFM elt
- lookupUDFM :: Uniquable key => UniqDFM elt -> key -> Maybe elt
- lookupUDFM_Directly :: UniqDFM elt -> Unique -> Maybe elt
- elemUDFM :: Uniquable key => key -> UniqDFM elt -> Bool
- foldUDFM :: (elt -> a -> a) -> a -> UniqDFM elt -> a
- eltsUDFM :: UniqDFM elt -> [elt]
- filterUDFM :: (elt -> Bool) -> UniqDFM elt -> UniqDFM elt
- filterUDFM_Directly :: (Unique -> elt -> Bool) -> UniqDFM elt -> UniqDFM elt
- isNullUDFM :: UniqDFM elt -> Bool
- sizeUDFM :: UniqDFM elt -> Int
- intersectUDFM :: UniqDFM elt -> UniqDFM elt -> UniqDFM elt
- udfmIntersectUFM :: UniqDFM elt -> UniqFM elt -> UniqDFM elt
- intersectsUDFM :: UniqDFM elt -> UniqDFM elt -> Bool
- disjointUDFM :: UniqDFM elt -> UniqDFM elt -> Bool
- disjointUdfmUfm :: UniqDFM elt -> UniqFM elt2 -> Bool
- minusUDFM :: UniqDFM elt1 -> UniqDFM elt2 -> UniqDFM elt1
- listToUDFM :: Uniquable key => [(key, elt)] -> UniqDFM elt
- udfmMinusUFM :: UniqDFM elt1 -> UniqFM elt2 -> UniqDFM elt1
- partitionUDFM :: (elt -> Bool) -> UniqDFM elt -> (UniqDFM elt, UniqDFM elt)
- anyUDFM :: (elt -> Bool) -> UniqDFM elt -> Bool
- allUDFM :: (elt -> Bool) -> UniqDFM elt -> Bool
- pprUDFM :: UniqDFM a -> ([a] -> SDoc) -> SDoc
- udfmToList :: UniqDFM elt -> [(Unique, elt)]
- udfmToUfm :: UniqDFM elt -> UniqFM elt
- nonDetFoldUDFM :: (elt -> a -> a) -> a -> UniqDFM elt -> a
- alwaysUnsafeUfmToUdfm :: UniqFM elt -> UniqDFM elt

# Unique-keyed deterministic mappings

data UniqDFM ele #

Type of unique deterministic finite maps

Instances

Functor UniqDFM # |
Methods fmap :: (a -> b) -> UniqDFM a -> UniqDFM b Source # (<$) :: a -> UniqDFM b -> UniqDFM a Source #
TrieMap UniqDFM # |
Associated Types type Key (UniqDFM :: * -> *) :: * # Methods emptyTM :: UniqDFM a # lookupTM :: Key UniqDFM -> UniqDFM b -> Maybe b # alterTM :: Key UniqDFM -> XT b -> UniqDFM b -> UniqDFM b # mapTM :: (a -> b) -> UniqDFM a -> UniqDFM b # foldTM :: (a -> b -> b) -> UniqDFM a -> b -> b #
Data ele => Data (UniqDFM ele) # |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UniqDFM ele -> c (UniqDFM ele) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (UniqDFM ele) Source #

toConstr :: UniqDFM ele -> Constr Source #

dataTypeOf :: UniqDFM ele -> DataType Source #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (UniqDFM ele)) Source #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (UniqDFM ele)) Source #

gmapT :: (forall b. Data b => b -> b) -> UniqDFM ele -> UniqDFM ele Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UniqDFM ele -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UniqDFM ele -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> UniqDFM ele -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UniqDFM ele -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UniqDFM ele -> m (UniqDFM ele) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UniqDFM ele -> m (UniqDFM ele) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UniqDFM ele -> m (UniqDFM ele) Source #

Monoid (UniqDFM a) # |
Methods mempty :: UniqDFM a Source # mappend :: UniqDFM a -> UniqDFM a -> UniqDFM a Source # mconcat :: [UniqDFM a] -> UniqDFM a Source #
Outputable a => Outputable (UniqDFM a) # |
Methods ppr :: UniqDFM a -> SDoc # pprPrec :: Rational -> UniqDFM a -> SDoc #
type Key UniqDFM # |
type Key UniqDFM = Unique

## Manipulating those mappings

emptyUDFM :: UniqDFM elt #

unitUDFM :: Uniquable key => key -> elt -> UniqDFM elt #

addToUDFM :: Uniquable key => UniqDFM elt -> key -> elt -> UniqDFM elt #

addToUDFM_C :: Uniquable key => (elt -> elt -> elt) -> UniqDFM elt -> key -> elt -> UniqDFM elt #

addListToUDFM :: Uniquable key => UniqDFM elt -> [(key, elt)] -> UniqDFM elt #

delFromUDFM :: Uniquable key => UniqDFM elt -> key -> UniqDFM elt #

delListFromUDFM :: Uniquable key => UniqDFM elt -> [key] -> UniqDFM elt #

Delete a list of elements from a UniqDFM

adjustUDFM :: Uniquable key => (elt -> elt) -> UniqDFM elt -> key -> UniqDFM elt #

Apply a function to a particular element

alterUDFM :: Uniquable key => (Maybe elt -> Maybe elt) -> UniqDFM elt -> key -> UniqDFM elt #

The expression (alterUDFM f k map) alters value x at k, or absence thereof. alterUDFM can be used to insert, delete, or update a value in UniqDFM. Use addToUDFM, delFromUDFM or adjustUDFM when possible, they are more efficient.

mapUDFM :: (elt1 -> elt2) -> UniqDFM elt1 -> UniqDFM elt2 #

Map a function over every value in a UniqDFM

plusUDFM :: UniqDFM elt -> UniqDFM elt -> UniqDFM elt #

plusUDFM_C :: (elt -> elt -> elt) -> UniqDFM elt -> UniqDFM elt -> UniqDFM elt #

lookupUDFM :: Uniquable key => UniqDFM elt -> key -> Maybe elt #

lookupUDFM_Directly :: UniqDFM elt -> Unique -> Maybe elt #

elemUDFM :: Uniquable key => key -> UniqDFM elt -> Bool #

foldUDFM :: (elt -> a -> a) -> a -> UniqDFM elt -> a #

Performs a deterministic fold over the UniqDFM. It's O(n log n) while the corresponding function on `UniqFM` is O(n).

eltsUDFM :: UniqDFM elt -> [elt] #

filterUDFM :: (elt -> Bool) -> UniqDFM elt -> UniqDFM elt #

filterUDFM_Directly :: (Unique -> elt -> Bool) -> UniqDFM elt -> UniqDFM elt #

isNullUDFM :: UniqDFM elt -> Bool #

sizeUDFM :: UniqDFM elt -> Int #

intersectUDFM :: UniqDFM elt -> UniqDFM elt -> UniqDFM elt #

udfmIntersectUFM :: UniqDFM elt -> UniqFM elt -> UniqDFM elt #

intersectsUDFM :: UniqDFM elt -> UniqDFM elt -> Bool #

disjointUDFM :: UniqDFM elt -> UniqDFM elt -> Bool #

disjointUdfmUfm :: UniqDFM elt -> UniqFM elt2 -> Bool #

minusUDFM :: UniqDFM elt1 -> UniqDFM elt2 -> UniqDFM elt1 #

listToUDFM :: Uniquable key => [(key, elt)] -> UniqDFM elt #

udfmMinusUFM :: UniqDFM elt1 -> UniqFM elt2 -> UniqDFM elt1 #

partitionUDFM :: (elt -> Bool) -> UniqDFM elt -> (UniqDFM elt, UniqDFM elt) #

Partition UniqDFM into two UniqDFMs according to the predicate

anyUDFM :: (elt -> Bool) -> UniqDFM elt -> Bool #

allUDFM :: (elt -> Bool) -> UniqDFM elt -> Bool #

pprUDFM #

Arguments

:: UniqDFM a | The things to be pretty printed
-> ([a] -> SDoc) | The pretty printing function to use on the elements
-> SDoc | `SDoc` where the things have been pretty printed

udfmToList :: UniqDFM elt -> [(Unique, elt)] #

Converts `UniqDFM` to a list, with elements in deterministic order. It's O(n log n) while the corresponding function on `UniqFM` is O(n).

udfmToUfm :: UniqDFM elt -> UniqFM elt #

This allows for lossy conversion from UniqDFM to UniqFM

nonDetFoldUDFM :: (elt -> a -> a) -> a -> UniqDFM elt -> a #

Performs a nondeterministic fold over the UniqDFM. It's O(n), same as the corresponding function on `UniqFM`. If you use this please provide a justification why it doesn't introduce nondeterminism.

alwaysUnsafeUfmToUdfm :: UniqFM elt -> UniqDFM elt #