UniqDSet

ghc-8.10.3: The GHC API

Safe Haskell | None
Language | Haskell2010

UniqDSet

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 UniqDFM for explanation why we need it.

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

Synopsis

- data UniqDSet a
- getUniqDSet :: UniqDSet a -> UniqDFM 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 b -> UniqDSet a
- intersectUniqDSets :: UniqDSet a -> UniqDSet a -> UniqDSet a
- uniqDSetIntersectUniqSet :: UniqDSet a -> UniqSet b -> UniqDSet a
- foldUniqDSet :: (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

# Unique set type

data UniqDSet a Source #

#### Instances

Instances details

Eq (UniqDSet a) # |
Instance details Defined in UniqDSet Methods (==) :: UniqDSet a -> UniqDSet a -> Bool # (/=) :: UniqDSet a -> UniqDSet a -> Bool #
Data a => Data (UniqDSet a) # |
Instance details Defined in UniqDSet Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UniqDSet a -> c (UniqDSet a) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (UniqDSet a) Source # toConstr :: UniqDSet a -> Constr Source # dataTypeOf :: UniqDSet a -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (UniqDSet a)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (UniqDSet a)) Source # gmapT :: (forall b. Data b => b -> b) -> UniqDSet a -> UniqDSet a Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UniqDSet a -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UniqDSet a -> r Source # gmapQ :: (forall d. Data d => d -> u) -> UniqDSet a -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> UniqDSet a -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UniqDSet a -> m (UniqDSet a) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UniqDSet a -> m (UniqDSet a) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UniqDSet a -> m (UniqDSet a) Source #
Semigroup (UniqDSet a) # |
Instance details Defined in UniqDSet Methods (<>) :: UniqDSet a -> UniqDSet a -> UniqDSet a Source # sconcat :: NonEmpty (UniqDSet a) -> UniqDSet a Source # stimes :: Integral b => b -> UniqDSet a -> UniqDSet a Source #
Monoid (UniqDSet a) # |
Instance details Defined in UniqDSet Methods mempty :: UniqDSet a Source # mappend :: UniqDSet a -> UniqDSet a -> UniqDSet a Source # mconcat :: [UniqDSet a] -> UniqDSet a Source #
Outputable a => Outputable (UniqDSet a) # |
Instance details Defined in UniqDSet Methods ppr :: UniqDSet a -> SDoc Source # pprPrec :: Rational -> UniqDSet a -> SDoc Source #

getUniqDSet :: UniqDSet a -> UniqDFM a Source #

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

## Manipulating these sets

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

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

emptyUniqDSet :: UniqDSet a Source #

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

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

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

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

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

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

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

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

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

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

foldUniqDSet :: (a -> b -> b) -> b -> UniqDSet a -> b Source #

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

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

sizeUniqDSet :: UniqDSet a -> Int Source #

isEmptyUniqDSet :: UniqDSet a -> Bool Source #

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

uniqDSetToList :: UniqDSet a -> [a] Source #

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

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