ghc-8.10.2: The GHC API
Safe HaskellNone
LanguageHaskell2010

UniqFM

Synopsis

Unique-keyed mappings

data UniqFM ele Source #

Instances

Instances details
Functor UniqFM # 
Instance details

Defined in UniqFM

Methods

fmap :: (a -> b) -> UniqFM a -> UniqFM b Source #

(<$) :: a -> UniqFM b -> UniqFM a Source #

Eq ele => Eq (UniqFM ele) # 
Instance details

Defined in UniqFM

Methods

(==) :: UniqFM ele -> UniqFM ele -> Bool #

(/=) :: UniqFM ele -> UniqFM ele -> Bool #

Data ele => Data (UniqFM ele) # 
Instance details

Defined in UniqFM

Methods

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

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

toConstr :: UniqFM ele -> Constr Source #

dataTypeOf :: UniqFM ele -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Semigroup (UniqFM a) # 
Instance details

Defined in UniqFM

Methods

(<>) :: UniqFM a -> UniqFM a -> UniqFM a Source #

sconcat :: NonEmpty (UniqFM a) -> UniqFM a Source #

stimes :: Integral b => b -> UniqFM a -> UniqFM a Source #

Monoid (UniqFM a) # 
Instance details

Defined in UniqFM

Outputable a => Outputable (UniqFM a) # 
Instance details

Defined in UniqFM

Methods

ppr :: UniqFM a -> SDoc Source #

pprPrec :: Rational -> UniqFM a -> SDoc Source #

newtype NonDetUniqFM ele Source #

A wrapper around UniqFM with the sole purpose of informing call sites that the provided Foldable and Traversable instances are nondeterministic. If you use this please provide a justification why it doesn't introduce nondeterminism. See Note [Deterministic UniqFM] in UniqDFM to learn about determinism.

Constructors

NonDetUniqFM 

Fields

Instances

Instances details
Functor NonDetUniqFM # 
Instance details

Defined in UniqFM

Methods

fmap :: (a -> b) -> NonDetUniqFM a -> NonDetUniqFM b Source #

(<$) :: a -> NonDetUniqFM b -> NonDetUniqFM a Source #

Foldable NonDetUniqFM #

Inherently nondeterministic. If you use this please provide a justification why it doesn't introduce nondeterminism. See Note [Deterministic UniqFM] in UniqDFM to learn about determinism.

Instance details

Defined in UniqFM

Methods

fold :: Monoid m => NonDetUniqFM m -> m Source #

foldMap :: Monoid m => (a -> m) -> NonDetUniqFM a -> m Source #

foldMap' :: Monoid m => (a -> m) -> NonDetUniqFM a -> m Source #

foldr :: (a -> b -> b) -> b -> NonDetUniqFM a -> b Source #

foldr' :: (a -> b -> b) -> b -> NonDetUniqFM a -> b Source #

foldl :: (b -> a -> b) -> b -> NonDetUniqFM a -> b Source #

foldl' :: (b -> a -> b) -> b -> NonDetUniqFM a -> b Source #

foldr1 :: (a -> a -> a) -> NonDetUniqFM a -> a Source #

foldl1 :: (a -> a -> a) -> NonDetUniqFM a -> a Source #

toList :: NonDetUniqFM a -> [a] Source #

null :: NonDetUniqFM a -> Bool Source #

length :: NonDetUniqFM a -> Int Source #

elem :: Eq a => a -> NonDetUniqFM a -> Bool Source #

maximum :: Ord a => NonDetUniqFM a -> a Source #

minimum :: Ord a => NonDetUniqFM a -> a Source #

sum :: Num a => NonDetUniqFM a -> a Source #

product :: Num a => NonDetUniqFM a -> a Source #

Traversable NonDetUniqFM #

Inherently nondeterministic. If you use this please provide a justification why it doesn't introduce nondeterminism. See Note [Deterministic UniqFM] in UniqDFM to learn about determinism.

Instance details

Defined in UniqFM

Methods

traverse :: Applicative f => (a -> f b) -> NonDetUniqFM a -> f (NonDetUniqFM b) Source #

sequenceA :: Applicative f => NonDetUniqFM (f a) -> f (NonDetUniqFM a) Source #

mapM :: Monad m => (a -> m b) -> NonDetUniqFM a -> m (NonDetUniqFM b) Source #

sequence :: Monad m => NonDetUniqFM (m a) -> m (NonDetUniqFM a) Source #

Manipulating those mappings

unitUFM :: Uniquable key => key -> elt -> UniqFM elt Source #

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

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

addToUFM :: Uniquable key => UniqFM elt -> key -> elt -> UniqFM elt Source #

addToUFM_C :: Uniquable key => (elt -> elt -> elt) -> UniqFM elt -> key -> elt -> UniqFM elt Source #

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

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

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

addToUFM_Directly :: UniqFM elt -> Unique -> elt -> UniqFM elt Source #

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

adjustUFM :: Uniquable key => (elt -> elt) -> UniqFM elt -> key -> UniqFM elt Source #

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

adjustUFM_Directly :: (elt -> elt) -> UniqFM elt -> Unique -> UniqFM elt Source #

delFromUFM :: Uniquable key => UniqFM elt -> key -> UniqFM elt Source #

delListFromUFM :: Uniquable key => UniqFM elt -> [key] -> UniqFM elt Source #

plusUFM :: UniqFM elt -> UniqFM elt -> UniqFM elt Source #

plusUFM_C :: (elt -> elt -> elt) -> UniqFM elt -> UniqFM elt -> UniqFM elt Source #

plusUFM_CD :: (elt -> elt -> elt) -> UniqFM elt -> elt -> UniqFM elt -> elt -> UniqFM elt Source #

`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 }

plusMaybeUFM_C :: (elt -> elt -> Maybe elt) -> UniqFM elt -> UniqFM elt -> UniqFM elt Source #

plusUFMList :: [UniqFM elt] -> UniqFM elt Source #

minusUFM :: UniqFM elt1 -> UniqFM elt2 -> UniqFM elt1 Source #

intersectUFM :: UniqFM elt1 -> UniqFM elt2 -> UniqFM elt1 Source #

intersectUFM_C :: (elt1 -> elt2 -> elt3) -> UniqFM elt1 -> UniqFM elt2 -> UniqFM elt3 Source #

disjointUFM :: UniqFM elt1 -> UniqFM elt2 -> Bool Source #

nonDetFoldUFM :: (elt -> a -> a) -> a -> UniqFM elt -> a Source #

foldUFM :: (elt -> a -> a) -> a -> UniqFM elt -> a Source #

nonDetFoldUFM_Directly :: (Unique -> elt -> a -> a) -> a -> UniqFM elt -> a Source #

anyUFM :: (elt -> Bool) -> UniqFM elt -> Bool Source #

allUFM :: (elt -> Bool) -> UniqFM elt -> Bool Source #

seqEltsUFM :: ([elt] -> ()) -> UniqFM elt -> () Source #

mapUFM :: (elt1 -> elt2) -> UniqFM elt1 -> UniqFM elt2 Source #

mapUFM_Directly :: (Unique -> elt1 -> elt2) -> UniqFM elt1 -> UniqFM elt2 Source #

elemUFM :: Uniquable key => key -> UniqFM elt -> Bool Source #

filterUFM :: (elt -> Bool) -> UniqFM elt -> UniqFM elt Source #

filterUFM_Directly :: (Unique -> elt -> Bool) -> UniqFM elt -> UniqFM elt Source #

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

lookupUFM :: Uniquable key => UniqFM elt -> key -> Maybe elt Source #

lookupWithDefaultUFM :: Uniquable key => UniqFM elt -> elt -> key -> elt Source #

nonDetEltsUFM :: UniqFM elt -> [elt] Source #

eltsUFM :: UniqFM elt -> [elt] Source #

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

pprUniqFM :: (a -> SDoc) -> UniqFM a -> SDoc Source #

pprUFM Source #

Arguments

:: UniqFM 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

Pretty-print a non-deterministic set. The order of variables is non-deterministic and for pretty-printing that shouldn't be a problem. Having this function helps contain the non-determinism created with nonDetEltsUFM.

pprUFMWithKeys Source #

Arguments

:: UniqFM a

The things to be pretty printed

-> ([(Unique, a)] -> SDoc)

The pretty printing function to use on the elements

-> SDoc

SDoc where the things have been pretty printed

Pretty-print a non-deterministic set. The order of variables is non-deterministic and for pretty-printing that shouldn't be a problem. Having this function helps contain the non-determinism created with nonDetUFMToList.

pluralUFM :: UniqFM a -> SDoc Source #

Determines the pluralisation suffix appropriate for the length of a set in the same way that plural from Outputable does for lists.