ghc-8.10.1: The GHC API

UniqDFM

Synopsis

# Unique-keyed deterministic mappings

data UniqDFM ele Source #

Type of unique deterministic finite maps

#### Instances

Instances details
 Source # Instance detailsDefined in UniqDFM Methodsfmap :: (a -> b) -> UniqDFM a -> UniqDFM b #(<\$) :: a -> UniqDFM b -> UniqDFM a # Source # Deterministic, in O(n log n). Instance detailsDefined in UniqDFM Methodsfold :: Monoid m => UniqDFM m -> m #foldMap :: Monoid m => (a -> m) -> UniqDFM a -> m #foldMap' :: Monoid m => (a -> m) -> UniqDFM a -> m #foldr :: (a -> b -> b) -> b -> UniqDFM a -> b #foldr' :: (a -> b -> b) -> b -> UniqDFM a -> b #foldl :: (b -> a -> b) -> b -> UniqDFM a -> b #foldl' :: (b -> a -> b) -> b -> UniqDFM a -> b #foldr1 :: (a -> a -> a) -> UniqDFM a -> a #foldl1 :: (a -> a -> a) -> UniqDFM a -> a #toList :: UniqDFM a -> [a] #null :: UniqDFM a -> Bool #length :: UniqDFM a -> Int #elem :: Eq a => a -> UniqDFM a -> Bool #maximum :: Ord a => UniqDFM a -> a #minimum :: Ord a => UniqDFM a -> a #sum :: Num a => UniqDFM a -> a #product :: Num a => UniqDFM a -> a # Source # Deterministic, in O(n log n). Instance detailsDefined in UniqDFM Methodstraverse :: Applicative f => (a -> f b) -> UniqDFM a -> f (UniqDFM b) #sequenceA :: Applicative f => UniqDFM (f a) -> f (UniqDFM a) #mapM :: Monad m => (a -> m b) -> UniqDFM a -> m (UniqDFM b) #sequence :: Monad m => UniqDFM (m a) -> m (UniqDFM a) # Source # Instance detailsDefined in TrieMap Associated Types MethodsalterTM :: Key UniqDFM -> XT b -> UniqDFM b -> UniqDFM b Source #mapTM :: (a -> b) -> UniqDFM a -> UniqDFM b Source #foldTM :: (a -> b -> b) -> UniqDFM a -> b -> b Source # Data ele => Data (UniqDFM ele) Source # Instance detailsDefined in UniqDFM Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UniqDFM ele -> c (UniqDFM ele) #gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (UniqDFM ele) #toConstr :: UniqDFM ele -> Constr #dataTypeOf :: UniqDFM ele -> DataType #dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (UniqDFM ele)) #dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (UniqDFM ele)) #gmapT :: (forall b. Data b => b -> b) -> UniqDFM ele -> UniqDFM ele #gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UniqDFM ele -> r #gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UniqDFM ele -> r #gmapQ :: (forall d. Data d => d -> u) -> UniqDFM ele -> [u] #gmapQi :: Int -> (forall d. Data d => d -> u) -> UniqDFM ele -> u #gmapM :: Monad m => (forall d. Data d => d -> m d) -> UniqDFM ele -> m (UniqDFM ele) #gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UniqDFM ele -> m (UniqDFM ele) #gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UniqDFM ele -> m (UniqDFM ele) # Source # Instance detailsDefined in UniqDFM Methods(<>) :: UniqDFM a -> UniqDFM a -> UniqDFM a #sconcat :: NonEmpty (UniqDFM a) -> UniqDFM a #stimes :: Integral b => b -> UniqDFM a -> UniqDFM a # Source # Instance detailsDefined in UniqDFM Methodsmappend :: UniqDFM a -> UniqDFM a -> UniqDFM a #mconcat :: [UniqDFM a] -> UniqDFM a # Outputable a => Outputable (UniqDFM a) Source # Instance detailsDefined in UniqDFM Methodsppr :: UniqDFM a -> SDoc Source # type Key UniqDFM Source # Instance detailsDefined in TrieMap type Key UniqDFM = Unique

## Manipulating those mappings

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

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

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

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

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

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

Delete a list of elements from a UniqDFM

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

Apply a function to a particular element

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

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 Source #

Map a function over every value in a UniqDFM

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

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

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

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

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

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] Source #

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

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

udfmIntersectUFM :: UniqDFM elt1 -> UniqFM elt2 -> UniqDFM elt1 Source #

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

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

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

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

Partition UniqDFM into two UniqDFMs according to the predicate

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

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

pprUniqDFM :: (a -> SDoc) -> UniqDFM a -> SDoc Source #

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)] Source #

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 Source #

This allows for lossy conversion from UniqDFM to UniqFM

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

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.