ghc-lib-parser-9.14.1.20251220: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Types.Unique.DSet

Contents

- Unique set type
  - Manipulating these sets

Description

Specialised deterministic sets, for things with `Uniques`

Based on `UniqDFM`s (as you would expect). See Note [Deterministic UniqFM] in GHC.Types.Unique.DFM for explanation why we need it.

Basically, the things need to be in class `Uniquable`.

Synopsis

- data UniqDSet a
- getUniqDSet :: UniqDSet a -> UniqDFM a a
- pprUniqDSet :: (a -> SDoc) -> UniqDSet a -> SDoc
- delOneFromUniqDSet :: Uniquable a => UniqDSet a -> a -> UniqDSet a
- delListFromUniqDSet :: Uniquable a => UniqDSet a -> [a] -> UniqDSet a
- emptyUniqDSet :: UniqDSet a
- unitUniqDSet :: Uniquable a => a -> UniqDSet a
- mkUniqDSet :: Uniquable a => [a] -> UniqDSet a
- addOneToUniqDSet :: Uniquable a => UniqDSet a -> a -> UniqDSet a
- addListToUniqDSet :: Uniquable a => UniqDSet a -> [a] -> UniqDSet a
- unionUniqDSets :: UniqDSet a -> UniqDSet a -> UniqDSet a
- unionManyUniqDSets :: [UniqDSet a] -> UniqDSet a
- minusUniqDSet :: UniqDSet a -> UniqDSet a -> UniqDSet a
- uniqDSetMinusUniqSet :: UniqDSet a -> UniqSet a -> UniqDSet a
- intersectUniqDSets :: UniqDSet a -> UniqDSet a -> UniqDSet a
- uniqDSetIntersectUniqSet :: UniqDSet a -> UniqSet a -> UniqDSet a
- nonDetStrictFoldUniqDSet :: (a -> b -> b) -> b -> UniqDSet a -> b
- elementOfUniqDSet :: Uniquable a => a -> UniqDSet a -> Bool
- filterUniqDSet :: (a -> Bool) -> UniqDSet a -> UniqDSet a
- sizeUniqDSet :: UniqDSet a -> Int
- isEmptyUniqDSet :: UniqDSet a -> Bool
- lookupUniqDSet :: Uniquable a => UniqDSet a -> a -> Maybe a
- uniqDSetToList :: UniqDSet a -> [a]
- partitionUniqDSet :: (a -> Bool) -> UniqDSet a -> (UniqDSet a, UniqDSet a)
- mapUniqDSet :: Uniquable b => (a -> b) -> UniqDSet a -> UniqDSet b
- strictFoldUniqDSet :: (a -> r -> r) -> r -> UniqDSet a -> r
- mapMUniqDSet :: (Monad m, Uniquable b) => (a -> m b) -> UniqDSet a -> m (UniqDSet b)

# Unique set type

data UniqDSet a #

#### Instances

Instances details

Data a => Data (UniqDSet a) # |
Instance details Defined in GHC.Types.Unique.DSet Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UniqDSet a -> c (UniqDSet a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (UniqDSet a) # toConstr :: UniqDSet a -> Constr # dataTypeOf :: UniqDSet a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (UniqDSet a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (UniqDSet a)) # gmapT :: (forall b. Data b => b -> b) -> UniqDSet a -> UniqDSet a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UniqDSet a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UniqDSet a -> r # gmapQ :: (forall d. Data d => d -> u) -> UniqDSet a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> UniqDSet a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UniqDSet a -> m (UniqDSet a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UniqDSet a -> m (UniqDSet a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UniqDSet a -> m (UniqDSet a) #
Outputable a => Outputable (UniqDSet a) # |
Instance details Defined in GHC.Types.Unique.DSet Methods ppr :: UniqDSet a -> SDoc #
Eq (UniqDSet a) # |
Instance details Defined in GHC.Types.Unique.DSet Methods (==) :: UniqDSet a -> UniqDSet a -> Bool # (/=) :: UniqDSet a -> UniqDSet a -> Bool #

getUniqDSet :: UniqDSet a -> UniqDFM a a #

pprUniqDSet :: (a -> SDoc) -> UniqDSet a -> SDoc #

## Manipulating these sets

delOneFromUniqDSet :: Uniquable a => UniqDSet a -> a -> UniqDSet a #

delListFromUniqDSet :: Uniquable a => UniqDSet a -> [a] -> UniqDSet a #

emptyUniqDSet :: UniqDSet a #

unitUniqDSet :: Uniquable a => a -> UniqDSet a #

mkUniqDSet :: Uniquable a => [a] -> UniqDSet a #

addOneToUniqDSet :: Uniquable a => UniqDSet a -> a -> UniqDSet a #

addListToUniqDSet :: Uniquable a => UniqDSet a -> [a] -> UniqDSet a #

unionUniqDSets :: UniqDSet a -> UniqDSet a -> UniqDSet a #

unionManyUniqDSets :: [UniqDSet a] -> UniqDSet a #

minusUniqDSet :: UniqDSet a -> UniqDSet a -> UniqDSet a #

uniqDSetMinusUniqSet :: UniqDSet a -> UniqSet a -> UniqDSet a #

intersectUniqDSets :: UniqDSet a -> UniqDSet a -> UniqDSet a #

uniqDSetIntersectUniqSet :: UniqDSet a -> UniqSet a -> UniqDSet a #

nonDetStrictFoldUniqDSet :: (a -> b -> b) -> b -> UniqDSet a -> b #

elementOfUniqDSet :: Uniquable a => a -> UniqDSet a -> Bool #

filterUniqDSet :: (a -> Bool) -> UniqDSet a -> UniqDSet a #

sizeUniqDSet :: UniqDSet a -> Int #

isEmptyUniqDSet :: UniqDSet a -> Bool #

lookupUniqDSet :: Uniquable a => UniqDSet a -> a -> Maybe a #

uniqDSetToList :: UniqDSet a -> [a] #

partitionUniqDSet :: (a -> Bool) -> UniqDSet a -> (UniqDSet a, UniqDSet a) #

mapUniqDSet :: Uniquable b => (a -> b) -> UniqDSet a -> UniqDSet b #

strictFoldUniqDSet :: (a -> r -> r) -> r -> UniqDSet a -> r #

mapMUniqDSet :: (Monad m, Uniquable b) => (a -> m b) -> UniqDSet a -> m (UniqDSet b) #

Like `mapUniqDSet` but for `mapM`. Assumes the function we are mapping over the `UniqDSet` does not modify uniques, as per Note [UniqSet invariant] in GHC.Types.Unique.Set.