ghc-8.0.0.20160111: The GHC API

Safe HaskellNone
LanguageHaskell2010

VarSet

Contents

Synopsis

Var, Id and TyVar set types

type VarSet = UniqSet Var

A non-deterministic set of variables. See Note [Deterministic UniqFM] in UniqDFM 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.

Manipulating these sets

extendVarSet_C :: (Var -> Var -> Var) -> VarSet -> Var -> VarSet

mapUnionVarSet :: (a -> VarSet) -> [a] -> VarSet

map the function oer the list, and union the results

foldVarSet :: (Var -> a -> a) -> a -> VarSet -> a

mapVarSet :: (Var -> Var) -> VarSet -> VarSet

seqVarSet :: VarSet -> ()

Deterministic Var set types

Manipulating these sets

extendDVarSetList :: DVarSet -> [Var] -> DVarSet

Add a list of variables to DVarSet

mapUnionDVarSet :: (a -> DVarSet) -> [a] -> DVarSet

Map the function over the list, and union the results

intersectsDVarSet :: DVarSet -> DVarSet -> Bool

True if non-empty intersection

disjointDVarSet :: DVarSet -> DVarSet -> Bool

True if empty intersection

delDVarSetList :: DVarSet -> [Var] -> DVarSet

Delete a list of variables from DVarSet

foldDVarSet :: (Var -> a -> a) -> a -> DVarSet -> a

transCloDVarSet :: (DVarSet -> DVarSet) -> DVarSet -> DVarSet

transCloVarSet for DVarSet

partitionDVarSet :: (Var -> Bool) -> DVarSet -> (DVarSet, DVarSet)

Partition DVarSet according to the predicate given