Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- type VarSet = UniqSet Var
- type IdSet = UniqSet Id
- type TyVarSet = UniqSet TyVar
- type CoVarSet = UniqSet CoVar
- type TyCoVarSet = UniqSet TyCoVar
- emptyVarSet :: VarSet
- unitVarSet :: Var -> VarSet
- mkVarSet :: [Var] -> VarSet
- extendVarSet :: VarSet -> Var -> VarSet
- extendVarSetList :: VarSet -> [Var] -> VarSet
- elemVarSet :: Var -> VarSet -> Bool
- subVarSet :: VarSet -> VarSet -> Bool
- unionVarSet :: VarSet -> VarSet -> VarSet
- unionVarSets :: [VarSet] -> VarSet
- mapUnionVarSet :: (a -> VarSet) -> [a] -> VarSet
- intersectVarSet :: VarSet -> VarSet -> VarSet
- intersectsVarSet :: VarSet -> VarSet -> Bool
- disjointVarSet :: VarSet -> VarSet -> Bool
- isEmptyVarSet :: VarSet -> Bool
- delVarSet :: VarSet -> Var -> VarSet
- delVarSetList :: VarSet -> [Var] -> VarSet
- delVarSetByKey :: VarSet -> Unique -> VarSet
- minusVarSet :: VarSet -> VarSet -> VarSet
- filterVarSet :: (Var -> Bool) -> VarSet -> VarSet
- mapVarSet :: Uniquable b => (a -> b) -> UniqSet a -> UniqSet b
- anyVarSet :: (Var -> Bool) -> VarSet -> Bool
- allVarSet :: (Var -> Bool) -> VarSet -> Bool
- transCloVarSet :: (VarSet -> VarSet) -> VarSet -> VarSet
- fixVarSet :: (VarSet -> VarSet) -> VarSet -> VarSet
- lookupVarSet_Directly :: VarSet -> Unique -> Maybe Var
- lookupVarSet :: VarSet -> Var -> Maybe Var
- lookupVarSetByName :: VarSet -> Name -> Maybe Var
- sizeVarSet :: VarSet -> Int
- seqVarSet :: VarSet -> ()
- elemVarSetByKey :: Unique -> VarSet -> Bool
- partitionVarSet :: (Var -> Bool) -> VarSet -> (VarSet, VarSet)
- pluralVarSet :: VarSet -> SDoc
- pprVarSet :: VarSet -> ([Var] -> SDoc) -> SDoc
- nonDetStrictFoldVarSet :: (Var -> a -> a) -> a -> VarSet -> a
- type DVarSet = UniqDSet Var
- type DIdSet = UniqDSet Id
- type DTyVarSet = UniqDSet TyVar
- type DCoVarSet = UniqDSet CoVar
- type DTyCoVarSet = UniqDSet TyCoVar
- emptyDVarSet :: DVarSet
- unitDVarSet :: Var -> DVarSet
- mkDVarSet :: [Var] -> DVarSet
- extendDVarSet :: DVarSet -> Var -> DVarSet
- extendDVarSetList :: DVarSet -> [Var] -> DVarSet
- elemDVarSet :: Var -> DVarSet -> Bool
- dVarSetElems :: DVarSet -> [Var]
- subDVarSet :: DVarSet -> DVarSet -> Bool
- unionDVarSet :: DVarSet -> DVarSet -> DVarSet
- unionDVarSets :: [DVarSet] -> DVarSet
- mapUnionDVarSet :: (a -> DVarSet) -> [a] -> DVarSet
- intersectDVarSet :: DVarSet -> DVarSet -> DVarSet
- dVarSetIntersectVarSet :: DVarSet -> VarSet -> DVarSet
- intersectsDVarSet :: DVarSet -> DVarSet -> Bool
- disjointDVarSet :: DVarSet -> DVarSet -> Bool
- isEmptyDVarSet :: DVarSet -> Bool
- delDVarSet :: DVarSet -> Var -> DVarSet
- delDVarSetList :: DVarSet -> [Var] -> DVarSet
- minusDVarSet :: DVarSet -> DVarSet -> DVarSet
- nonDetStrictFoldDVarSet :: (Var -> a -> a) -> a -> DVarSet -> a
- filterDVarSet :: (Var -> Bool) -> DVarSet -> DVarSet
- mapDVarSet :: Uniquable b => (a -> b) -> UniqDSet a -> UniqDSet b
- strictFoldDVarSet :: (a -> r -> r) -> r -> UniqDSet a -> r
- dVarSetMinusVarSet :: DVarSet -> VarSet -> DVarSet
- anyDVarSet :: (Var -> Bool) -> DVarSet -> Bool
- allDVarSet :: (Var -> Bool) -> DVarSet -> Bool
- transCloDVarSet :: (DVarSet -> DVarSet) -> DVarSet -> DVarSet
- sizeDVarSet :: DVarSet -> Int
- seqDVarSet :: DVarSet -> ()
- partitionDVarSet :: (Var -> Bool) -> DVarSet -> (DVarSet, DVarSet)
- dVarSetToVarSet :: DVarSet -> VarSet
Var, Id and TyVar set types
type VarSet = UniqSet Var Source #
A non-deterministic Variable Set
A non-deterministic set of variables. See Note [Deterministic UniqFM] in GHC.Types.Unique.DFM for explanation why it's not deterministic and why it matters. Use DVarSet if the set eventually gets converted into a list or folded over in a way where the order changes the generated code, for example when abstracting variables.
type TyCoVarSet = UniqSet TyCoVar Source #
Type or Coercion Variable Set
Manipulating these sets
emptyVarSet :: VarSet Source #
unitVarSet :: Var -> VarSet Source #
unionVarSets :: [VarSet] -> VarSet Source #
mapUnionVarSet :: (a -> VarSet) -> [a] -> VarSet Source #
map the function over the list, and union the results
isEmptyVarSet :: VarSet -> Bool Source #
sizeVarSet :: VarSet -> Int Source #
pluralVarSet :: VarSet -> SDoc Source #
Determines the pluralisation suffix appropriate for the length of a set in the same way that plural from Outputable does for lists.
:: VarSet | The things to be pretty printed |
-> ([Var] -> SDoc) | The pretty printing function to use on the elements |
-> SDoc |
|
Pretty-print a non-deterministic set. The order of variables is non-deterministic and for pretty-printing that shouldn't be a problem. Having this function helps contain the non-determinism created with nonDetEltsUFM. Passing a list to the pretty-printing function allows the caller to decide on the order of Vars (eg. toposort them) without them having to use nonDetEltsUFM at the call site. This prevents from let-binding non-deterministically ordered lists and reusing them where determinism matters.
nonDetStrictFoldVarSet :: (Var -> a -> a) -> a -> VarSet -> a Source #
Deterministic Var set types
type DTyCoVarSet = UniqDSet TyCoVar Source #
Deterministic Type or Coercion Variable Set
Manipulating these sets
unitDVarSet :: Var -> DVarSet Source #
dVarSetElems :: DVarSet -> [Var] Source #
unionDVarSets :: [DVarSet] -> DVarSet Source #
mapUnionDVarSet :: (a -> DVarSet) -> [a] -> DVarSet Source #
Map the function over the list, and union the results
isEmptyDVarSet :: DVarSet -> Bool Source #
nonDetStrictFoldDVarSet :: (Var -> a -> a) -> a -> DVarSet -> a Source #
strictFoldDVarSet :: (a -> r -> r) -> r -> UniqDSet a -> r Source #
sizeDVarSet :: DVarSet -> Int Source #
seqDVarSet :: DVarSet -> () Source #
partitionDVarSet :: (Var -> Bool) -> DVarSet -> (DVarSet, DVarSet) Source #
Partition DVarSet according to the predicate given
dVarSetToVarSet :: DVarSet -> VarSet Source #
Convert a DVarSet to a VarSet by forgetting the order of insertion