Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data UniqDFM key ele
- emptyUDFM :: UniqDFM key elt
- unitUDFM :: Uniquable key => key -> elt -> UniqDFM key elt
- addToUDFM :: Uniquable key => UniqDFM key elt -> key -> elt -> UniqDFM key elt
- addToUDFM_C :: Uniquable key => (elt -> elt -> elt) -> UniqDFM key elt -> key -> elt -> UniqDFM key elt
- addToUDFM_C_Directly :: (elt -> elt -> elt) -> UniqDFM key elt -> Unique -> elt -> UniqDFM key elt
- addToUDFM_Directly :: UniqDFM key elt -> Unique -> elt -> UniqDFM key elt
- addListToUDFM :: Uniquable key => UniqDFM key elt -> [(key, elt)] -> UniqDFM key elt
- delFromUDFM :: Uniquable key => UniqDFM key elt -> key -> UniqDFM key elt
- delListFromUDFM :: Uniquable key => UniqDFM key elt -> [key] -> UniqDFM key elt
- adjustUDFM :: Uniquable key => (elt -> elt) -> UniqDFM key elt -> key -> UniqDFM key elt
- adjustUDFM_Directly :: (elt -> elt) -> UniqDFM key elt -> Unique -> UniqDFM key elt
- alterUDFM :: Uniquable key => (Maybe elt -> Maybe elt) -> UniqDFM key elt -> key -> UniqDFM key elt
- mapUDFM :: (elt1 -> elt2) -> UniqDFM key elt1 -> UniqDFM key elt2
- plusUDFM :: UniqDFM key elt -> UniqDFM key elt -> UniqDFM key elt
- plusUDFM_C :: (elt -> elt -> elt) -> UniqDFM key elt -> UniqDFM key elt -> UniqDFM key elt
- lookupUDFM :: Uniquable key => UniqDFM key elt -> key -> Maybe elt
- lookupUDFM_Directly :: UniqDFM key elt -> Unique -> Maybe elt
- elemUDFM :: Uniquable key => key -> UniqDFM key elt -> Bool
- foldUDFM :: (elt -> a -> a) -> a -> UniqDFM key elt -> a
- eltsUDFM :: UniqDFM key elt -> [elt]
- filterUDFM :: (elt -> Bool) -> UniqDFM key elt -> UniqDFM key elt
- filterUDFM_Directly :: (Unique -> elt -> Bool) -> UniqDFM key elt -> UniqDFM key elt
- isNullUDFM :: UniqDFM key elt -> Bool
- sizeUDFM :: UniqDFM key elt -> Int
- intersectUDFM :: UniqDFM key elt -> UniqDFM key elt -> UniqDFM key elt
- udfmIntersectUFM :: UniqDFM key elt1 -> UniqFM key elt2 -> UniqDFM key elt1
- disjointUDFM :: UniqDFM key elt -> UniqDFM key elt -> Bool
- disjointUdfmUfm :: UniqDFM key elt -> UniqFM key elt2 -> Bool
- equalKeysUDFM :: UniqDFM key a -> UniqDFM key b -> Bool
- minusUDFM :: UniqDFM key elt1 -> UniqDFM key elt2 -> UniqDFM key elt1
- listToUDFM :: Uniquable key => [(key, elt)] -> UniqDFM key elt
- listToUDFM_Directly :: [(Unique, elt)] -> UniqDFM key elt
- udfmMinusUFM :: UniqDFM key elt1 -> UniqFM key elt2 -> UniqDFM key elt1
- ufmMinusUDFM :: UniqFM key elt1 -> UniqDFM key elt2 -> UniqFM key elt1
- partitionUDFM :: (elt -> Bool) -> UniqDFM key elt -> (UniqDFM key elt, UniqDFM key elt)
- anyUDFM :: (elt -> Bool) -> UniqDFM key elt -> Bool
- allUDFM :: (elt -> Bool) -> UniqDFM key elt -> Bool
- pprUniqDFM :: (a -> SDoc) -> UniqDFM key a -> SDoc
- pprUDFM :: UniqDFM key a -> ([a] -> SDoc) -> SDoc
- udfmToList :: UniqDFM key elt -> [(Unique, elt)]
- udfmToUfm :: UniqDFM key elt -> UniqFM key elt
- nonDetStrictFoldUDFM :: (elt -> a -> a) -> a -> UniqDFM key elt -> a
- unsafeCastUDFMKey :: UniqDFM key1 elt -> UniqDFM key2 elt
- alwaysUnsafeUfmToUdfm :: UniqFM key elt -> UniqDFM key elt
Unique-keyed deterministic mappings
Type of unique deterministic finite maps
The key is just here to keep us honest. It's always safe to use a single type as key. If two types don't overlap in their uniques it's also safe to index the same map at multiple key types. But this is very much discouraged.
Instances
Functor (UniqDFM key) # | |
Foldable (UniqDFM key) # | Deterministic, in O(n log n). |
Defined in GHC.Types.Unique.DFM fold :: Monoid m => UniqDFM key m -> m Source # foldMap :: Monoid m => (a -> m) -> UniqDFM key a -> m Source # foldMap' :: Monoid m => (a -> m) -> UniqDFM key a -> m Source # foldr :: (a -> b -> b) -> b -> UniqDFM key a -> b Source # foldr' :: (a -> b -> b) -> b -> UniqDFM key a -> b Source # foldl :: (b -> a -> b) -> b -> UniqDFM key a -> b Source # foldl' :: (b -> a -> b) -> b -> UniqDFM key a -> b Source # foldr1 :: (a -> a -> a) -> UniqDFM key a -> a Source # foldl1 :: (a -> a -> a) -> UniqDFM key a -> a Source # toList :: UniqDFM key a -> [a] Source # null :: UniqDFM key a -> Bool Source # length :: UniqDFM key a -> Int Source # elem :: Eq a => a -> UniqDFM key a -> Bool Source # maximum :: Ord a => UniqDFM key a -> a Source # minimum :: Ord a => UniqDFM key a -> a Source # | |
Traversable (UniqDFM key) # | Deterministic, in O(n log n). |
Defined in GHC.Types.Unique.DFM traverse :: Applicative f => (a -> f b) -> UniqDFM key a -> f (UniqDFM key b) Source # sequenceA :: Applicative f => UniqDFM key (f a) -> f (UniqDFM key a) Source # mapM :: Monad m => (a -> m b) -> UniqDFM key a -> m (UniqDFM key b) Source # sequence :: Monad m => UniqDFM key (m a) -> m (UniqDFM key a) Source # | |
Uniquable key => TrieMap (UniqDFM key) # | |
Defined in GHC.Data.TrieMap | |
(Data key, Data ele) => Data (UniqDFM key ele) # | |
Defined in GHC.Types.Unique.DFM gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UniqDFM key ele -> c (UniqDFM key ele) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (UniqDFM key ele) Source # toConstr :: UniqDFM key ele -> Constr Source # dataTypeOf :: UniqDFM key ele -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (UniqDFM key ele)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (UniqDFM key ele)) Source # gmapT :: (forall b. Data b => b -> b) -> UniqDFM key ele -> UniqDFM key ele Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UniqDFM key ele -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UniqDFM key ele -> r Source # gmapQ :: (forall d. Data d => d -> u) -> UniqDFM key ele -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> UniqDFM key ele -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UniqDFM key ele -> m (UniqDFM key ele) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UniqDFM key ele -> m (UniqDFM key ele) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UniqDFM key ele -> m (UniqDFM key ele) Source # | |
Semigroup (UniqDFM key a) # | |
Monoid (UniqDFM key a) # | |
Outputable a => Outputable (UniqDFM key a) # | |
type Key (UniqDFM key) # | |
Defined in GHC.Data.TrieMap |
Manipulating those mappings
addToUDFM_C :: Uniquable key => (elt -> elt -> elt) -> UniqDFM key elt -> key -> elt -> UniqDFM key elt Source #
addToUDFM_C_Directly :: (elt -> elt -> elt) -> UniqDFM key elt -> Unique -> elt -> UniqDFM key elt Source #
delListFromUDFM :: Uniquable key => UniqDFM key elt -> [key] -> UniqDFM key elt Source #
Delete a list of elements from a UniqDFM
adjustUDFM :: Uniquable key => (elt -> elt) -> UniqDFM key elt -> key -> UniqDFM key elt Source #
Apply a function to a particular element
adjustUDFM_Directly :: (elt -> elt) -> UniqDFM key elt -> Unique -> UniqDFM key elt Source #
Apply a function to a particular element
alterUDFM :: Uniquable key => (Maybe elt -> Maybe elt) -> UniqDFM key elt -> key -> UniqDFM key 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 key elt1 -> UniqDFM key elt2 Source #
Map a function over every value in a UniqDFM
foldUDFM :: (elt -> a -> a) -> a -> UniqDFM key 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).
isNullUDFM :: UniqDFM key elt -> Bool Source #
listToUDFM :: Uniquable key => [(key, elt)] -> UniqDFM key elt Source #
listToUDFM_Directly :: [(Unique, elt)] -> UniqDFM key elt Source #
partitionUDFM :: (elt -> Bool) -> UniqDFM key elt -> (UniqDFM key elt, UniqDFM key elt) Source #
Partition UniqDFM into two UniqDFMs according to the predicate
udfmToList :: UniqDFM key elt -> [(Unique, elt)] Source #
udfmToUfm :: UniqDFM key elt -> UniqFM key elt Source #
This allows for lossy conversion from UniqDFM to UniqFM
nonDetStrictFoldUDFM :: (elt -> a -> a) -> a -> UniqDFM key elt -> a Source #
Performs a nondeterministic strict 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.
unsafeCastUDFMKey :: UniqDFM key1 elt -> UniqDFM key2 elt Source #
Cast the key domain of a UniqFM.
As long as the domains don't overlap in their uniques this is safe.
alwaysUnsafeUfmToUdfm :: UniqFM key elt -> UniqDFM key elt Source #