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

Safe Haskell | Ignore
Language | GHC2021

GHC.Types.Unique.Set

Contents

- Unique set type
  - Manipulating these sets

Synopsis

- data UniqSet a
- getUniqSet :: UniqSet a -> UniqFM a a
- pprUniqSet :: (a -> SDoc) -> UniqSet a -> SDoc
- emptyUniqSet :: UniqSet a
- unitUniqSet :: Uniquable a => a -> UniqSet a
- mkUniqSet :: Uniquable a => [a] -> UniqSet a
- addOneToUniqSet :: Uniquable a => UniqSet a -> a -> UniqSet a
- addListToUniqSet :: Uniquable a => UniqSet a -> [a] -> UniqSet a
- delOneFromUniqSet :: Uniquable a => UniqSet a -> a -> UniqSet a
- delOneFromUniqSet_Directly :: UniqSet a -> Unique -> UniqSet a
- delListFromUniqSet :: Uniquable a => UniqSet a -> [a] -> UniqSet a
- delListFromUniqSet_Directly :: UniqSet a -> [Unique] -> UniqSet a
- unionUniqSets :: UniqSet a -> UniqSet a -> UniqSet a
- unionManyUniqSets :: [UniqSet a] -> UniqSet a
- minusUniqSet :: UniqSet a -> UniqSet a -> UniqSet a
- uniqSetMinusUFM :: UniqSet key -> UniqFM key b -> UniqSet key
- uniqSetMinusUDFM :: UniqSet key -> UniqDFM key b -> UniqSet key
- intersectUniqSets :: UniqSet a -> UniqSet a -> UniqSet a
- disjointUniqSets :: UniqSet a -> UniqSet a -> Bool
- restrictUniqSetToUFM :: UniqSet key -> UniqFM key b -> UniqSet key
- uniqSetAny :: (a -> Bool) -> UniqSet a -> Bool
- uniqSetAll :: (a -> Bool) -> UniqSet a -> Bool
- elementOfUniqSet :: Uniquable a => a -> UniqSet a -> Bool
- elemUniqSet_Directly :: Unique -> UniqSet a -> Bool
- filterUniqSet :: (a -> Bool) -> UniqSet a -> UniqSet a
- filterUniqSet_Directly :: (Unique -> elt -> Bool) -> UniqSet elt -> UniqSet elt
- sizeUniqSet :: UniqSet a -> Int
- isEmptyUniqSet :: UniqSet a -> Bool
- lookupUniqSet :: Uniquable key => UniqSet key -> key -> Maybe key
- lookupUniqSet_Directly :: UniqSet a -> Unique -> Maybe a
- partitionUniqSet :: (a -> Bool) -> UniqSet a -> (UniqSet a, UniqSet a)
- mapUniqSet :: Uniquable b => (a -> b) -> UniqSet a -> UniqSet b
- unsafeUFMToUniqSet :: UniqFM a a -> UniqSet a
- nonDetEltsUniqSet :: UniqSet elt -> [elt]
- nonDetKeysUniqSet :: UniqSet elt -> [Unique]
- nonDetStrictFoldUniqSet :: (elt -> a -> a) -> a -> UniqSet elt -> a
- mapMaybeUniqSet_sameUnique :: (a -> Maybe b) -> UniqSet a -> UniqSet b
- newtype UniqueSet = US {
  - unUniqueSet :: Word64Set
  }
- nullUniqueSet :: UniqueSet -> Bool
- sizeUniqueSet :: UniqueSet -> Int
- memberUniqueSet :: Unique -> UniqueSet -> Bool
- emptyUniqueSet :: UniqueSet
- singletonUniqueSet :: Unique -> UniqueSet
- insertUniqueSet :: Unique -> UniqueSet -> UniqueSet
- deleteUniqueSet :: Unique -> UniqueSet -> UniqueSet
- differenceUniqueSet :: UniqueSet -> UniqueSet -> UniqueSet
- unionUniqueSet :: UniqueSet -> UniqueSet -> UniqueSet
- unionsUniqueSet :: [UniqueSet] -> UniqueSet
- intersectionUniqueSet :: UniqueSet -> UniqueSet -> UniqueSet
- isSubsetOfUniqueSet :: UniqueSet -> UniqueSet -> Bool
- filterUniqueSet :: (Unique -> Bool) -> UniqueSet -> UniqueSet
- foldlUniqueSet :: (a -> Unique -> a) -> a -> UniqueSet -> a
- foldrUniqueSet :: (Unique -> b -> b) -> b -> UniqueSet -> b
- elemsUniqueSet :: UniqueSet -> [Unique]
- fromListUniqueSet :: [Unique] -> UniqueSet

# Unique set type

data UniqSet a Source #

Set of Uniquable values

#### Instances

Instances details

NFData a => NFData (UniqSet a) Source # |
Instance details Defined in GHC.Types.Unique.Set Methods rnf :: UniqSet a -> () Source #
Monoid (UniqSet a) Source # |
Instance details Defined in GHC.Types.Unique.Set Methods mempty :: UniqSet a Source # mappend :: UniqSet a -> UniqSet a -> UniqSet a Source # mconcat :: [UniqSet a] -> UniqSet a Source #
Semigroup (UniqSet a) Source # |
Instance details Defined in GHC.Types.Unique.Set Methods (<>) :: UniqSet a -> UniqSet a -> UniqSet a Source # sconcat :: NonEmpty (UniqSet a) -> UniqSet a Source # stimes :: Integral b => b -> UniqSet a -> UniqSet a Source #
Data a => Data (UniqSet a) Source # |

Instance details

Defined in GHC.Types.Unique.Set

Methods

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

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

toConstr :: UniqSet a -> Constr Source #

dataTypeOf :: UniqSet a -> DataType Source #

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

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

gmapT :: (forall b. Data b => b -> b) -> UniqSet a -> UniqSet a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UniqSet a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UniqSet a -> r Source #

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

gmapQi :: Int -> (forall d. Data d => d -> u) -> UniqSet a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UniqSet a -> m (UniqSet a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UniqSet a -> m (UniqSet a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UniqSet a -> m (UniqSet a) Source #

Outputable a => Outputable (UniqSet a) Source # |
Instance details Defined in GHC.Types.Unique.Set Methods ppr :: UniqSet a -> SDoc Source #
Eq (UniqSet a) Source # |
Instance details Defined in GHC.Types.Unique.Set Methods (==) :: UniqSet a -> UniqSet a -> Bool Source # (/=) :: UniqSet a -> UniqSet a -> Bool Source #

getUniqSet :: UniqSet a -> UniqFM a a Source #

pprUniqSet :: (a -> SDoc) -> UniqSet a -> SDoc Source #

## Manipulating these sets

emptyUniqSet :: UniqSet a Source #

unitUniqSet :: Uniquable a => a -> UniqSet a Source #

mkUniqSet :: Uniquable a => [a] -> UniqSet a Source #

addOneToUniqSet :: Uniquable a => UniqSet a -> a -> UniqSet a Source #

addListToUniqSet :: Uniquable a => UniqSet a -> [a] -> UniqSet a Source #

delOneFromUniqSet :: Uniquable a => UniqSet a -> a -> UniqSet a Source #

delOneFromUniqSet_Directly :: UniqSet a -> Unique -> UniqSet a Source #

delListFromUniqSet :: Uniquable a => UniqSet a -> [a] -> UniqSet a Source #

delListFromUniqSet_Directly :: UniqSet a -> [Unique] -> UniqSet a Source #

unionUniqSets :: UniqSet a -> UniqSet a -> UniqSet a Source #

unionManyUniqSets :: [UniqSet a] -> UniqSet a Source #

minusUniqSet :: UniqSet a -> UniqSet a -> UniqSet a Source #

uniqSetMinusUFM :: UniqSet key -> UniqFM key b -> UniqSet key Source #

uniqSetMinusUDFM :: UniqSet key -> UniqDFM key b -> UniqSet key Source #

intersectUniqSets :: UniqSet a -> UniqSet a -> UniqSet a Source #

disjointUniqSets :: UniqSet a -> UniqSet a -> Bool Source #

restrictUniqSetToUFM :: UniqSet key -> UniqFM key b -> UniqSet key Source #

uniqSetAny :: (a -> Bool) -> UniqSet a -> Bool Source #

uniqSetAll :: (a -> Bool) -> UniqSet a -> Bool Source #

elementOfUniqSet :: Uniquable a => a -> UniqSet a -> Bool Source #

elemUniqSet_Directly :: Unique -> UniqSet a -> Bool Source #

filterUniqSet :: (a -> Bool) -> UniqSet a -> UniqSet a Source #

filterUniqSet_Directly :: (Unique -> elt -> Bool) -> UniqSet elt -> UniqSet elt Source #

sizeUniqSet :: UniqSet a -> Int Source #

isEmptyUniqSet :: UniqSet a -> Bool Source #

lookupUniqSet :: Uniquable key => UniqSet key -> key -> Maybe key Source #

What's the point you might ask? We might have changed an object without it's key changing. In which case this lookup makes sense.

lookupUniqSet_Directly :: UniqSet a -> Unique -> Maybe a Source #

partitionUniqSet :: (a -> Bool) -> UniqSet a -> (UniqSet a, UniqSet a) Source #

mapUniqSet :: Uniquable b => (a -> b) -> UniqSet a -> UniqSet b Source #

unsafeUFMToUniqSet :: UniqFM a a -> UniqSet a Source #

`unsafeUFMToUniqSet` converts a ``UniqFM` a` into a ``UniqSet` a` assuming, without checking, that it maps each `Unique` to a value that has that `Unique`. See Note [UniqSet invariant].

nonDetEltsUniqSet :: UniqSet elt -> [elt] Source #

nonDetKeysUniqSet :: UniqSet elt -> [Unique] Source #

nonDetStrictFoldUniqSet :: (elt -> a -> a) -> a -> UniqSet elt -> a Source #

mapMaybeUniqSet_sameUnique :: (a -> Maybe b) -> UniqSet a -> UniqSet b Source #

Like `mapMaybe`, but you must ensure the passed in function does not change the `Unique`.

newtype UniqueSet Source #

Set of Unique values

Similar to 'UniqSet Unique' but with a more compact representation.

Constructors

US |

Fields

- unUniqueSet :: Word64Set

#### Instances

Instances details

Monoid UniqueSet Source # |
Instance details Defined in GHC.Types.Unique.Set Methods mempty :: UniqueSet Source # mappend :: UniqueSet -> UniqueSet -> UniqueSet Source # mconcat :: [UniqueSet] -> UniqueSet Source #
Semigroup UniqueSet Source # |
Instance details Defined in GHC.Types.Unique.Set Methods (<>) :: UniqueSet -> UniqueSet -> UniqueSet Source # sconcat :: NonEmpty UniqueSet -> UniqueSet Source # stimes :: Integral b => b -> UniqueSet -> UniqueSet Source #
Show UniqueSet Source # |
Instance details Defined in GHC.Types.Unique.Set Methods showsPrec :: Int -> UniqueSet -> ShowS Source # show :: UniqueSet -> String Source # showList :: [UniqueSet] -> ShowS Source #
Eq UniqueSet Source # |
Instance details Defined in GHC.Types.Unique.Set Methods (==) :: UniqueSet -> UniqueSet -> Bool Source # (/=) :: UniqueSet -> UniqueSet -> Bool Source #
Ord UniqueSet Source # |

Instance details

Defined in GHC.Types.Unique.Set

Methods

compare :: UniqueSet -> UniqueSet -> Ordering Source #

(<) :: UniqueSet -> UniqueSet -> Bool Source #

(<=) :: UniqueSet -> UniqueSet -> Bool Source #

(>) :: UniqueSet -> UniqueSet -> Bool Source #

(>=) :: UniqueSet -> UniqueSet -> Bool Source #

max :: UniqueSet -> UniqueSet -> UniqueSet Source #

min :: UniqueSet -> UniqueSet -> UniqueSet Source #

nullUniqueSet :: UniqueSet -> Bool Source #

sizeUniqueSet :: UniqueSet -> Int Source #

memberUniqueSet :: Unique -> UniqueSet -> Bool Source #

emptyUniqueSet :: UniqueSet Source #

singletonUniqueSet :: Unique -> UniqueSet Source #

insertUniqueSet :: Unique -> UniqueSet -> UniqueSet Source #

deleteUniqueSet :: Unique -> UniqueSet -> UniqueSet Source #

differenceUniqueSet :: UniqueSet -> UniqueSet -> UniqueSet Source #

unionUniqueSet :: UniqueSet -> UniqueSet -> UniqueSet Source #

unionsUniqueSet :: [UniqueSet] -> UniqueSet Source #

intersectionUniqueSet :: UniqueSet -> UniqueSet -> UniqueSet Source #

isSubsetOfUniqueSet :: UniqueSet -> UniqueSet -> Bool Source #

filterUniqueSet :: (Unique -> Bool) -> UniqueSet -> UniqueSet Source #

foldlUniqueSet :: (a -> Unique -> a) -> a -> UniqueSet -> a Source #

foldrUniqueSet :: (Unique -> b -> b) -> b -> UniqueSet -> b Source #

elemsUniqueSet :: UniqueSet -> [Unique] Source #

fromListUniqueSet :: [Unique] -> UniqueSet Source #