| |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Description | |||||||||||||||||||||||||||||||||||||||
A module concerned with finding the free variables of an expression. | |||||||||||||||||||||||||||||||||||||||
Synopsis | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
Free variables of expressions and binding groups | |||||||||||||||||||||||||||||||||||||||
exprFreeVars :: CoreExpr -> VarSet | |||||||||||||||||||||||||||||||||||||||
Find all locally-defined free Ids or type variables in an expression | |||||||||||||||||||||||||||||||||||||||
exprsFreeVars :: [CoreExpr] -> VarSet | |||||||||||||||||||||||||||||||||||||||
Find all locally-defined free Ids or type variables in several expressions | |||||||||||||||||||||||||||||||||||||||
bindFreeVars :: CoreBind -> VarSet | |||||||||||||||||||||||||||||||||||||||
Find all locally defined free Ids in a binding group | |||||||||||||||||||||||||||||||||||||||
Selective free variables of expressions | |||||||||||||||||||||||||||||||||||||||
type InterestingVarFun = Var -> Bool | |||||||||||||||||||||||||||||||||||||||
Predicate on possible free variables: returns True iff the variable is interesting | |||||||||||||||||||||||||||||||||||||||
exprSomeFreeVars | |||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||
exprsSomeFreeVars :: InterestingVarFun -> [CoreExpr] -> VarSet | |||||||||||||||||||||||||||||||||||||||
Finds free variables in several expressions selected by a predicate | |||||||||||||||||||||||||||||||||||||||
exprFreeNames :: CoreExpr -> NameSet | |||||||||||||||||||||||||||||||||||||||
Finds the free external names of an expression, notably including the names of type constructors (which of course do not show up in exprFreeVars). | |||||||||||||||||||||||||||||||||||||||
exprsFreeNames :: [CoreExpr] -> NameSet | |||||||||||||||||||||||||||||||||||||||
Finds the free external names of several expressions: see exprFreeNames for details | |||||||||||||||||||||||||||||||||||||||
Free variables of Rules, Vars and Ids | |||||||||||||||||||||||||||||||||||||||
idRuleVars :: Id -> VarSet | |||||||||||||||||||||||||||||||||||||||
idFreeVars :: Id -> VarSet | |||||||||||||||||||||||||||||||||||||||
varTypeTyVars :: Var -> TyVarSet | |||||||||||||||||||||||||||||||||||||||
varTypeTcTyVars :: Var -> TyVarSet | |||||||||||||||||||||||||||||||||||||||
ruleRhsFreeVars :: CoreRule -> VarSet | |||||||||||||||||||||||||||||||||||||||
Those variables free in the right hand side of a rule | |||||||||||||||||||||||||||||||||||||||
rulesFreeVars :: [CoreRule] -> VarSet | |||||||||||||||||||||||||||||||||||||||
Those variables free in the right hand side of several rules | |||||||||||||||||||||||||||||||||||||||
ruleLhsFreeNames :: CoreRule -> NameSet | |||||||||||||||||||||||||||||||||||||||
Similar to exprFreeNames. However, this is used when deciding whether a rule is an orphan. In particular, suppose that T is defined in this module; we want to avoid declaring that a rule like: fromIntegral T = fromIntegral_T is an orphan. Of course it isn't, and declaring it an orphan would make the whole module an orphan module, which is bad. | |||||||||||||||||||||||||||||||||||||||
ruleLhsFreeIds :: CoreRule -> VarSet | |||||||||||||||||||||||||||||||||||||||
This finds all locally-defined free Ids on the left hand side of a rule | |||||||||||||||||||||||||||||||||||||||
Core syntax tree annotation with free variables | |||||||||||||||||||||||||||||||||||||||
type CoreExprWithFVs = AnnExpr Id VarSet | |||||||||||||||||||||||||||||||||||||||
Every node in an expression annotated with its (non-global) free variables, both Ids and TyVars | |||||||||||||||||||||||||||||||||||||||
type CoreBindWithFVs = AnnBind Id VarSet | |||||||||||||||||||||||||||||||||||||||
Every node in a binding group annotated with its (non-global) free variables, both Ids and TyVars | |||||||||||||||||||||||||||||||||||||||
freeVars :: CoreExpr -> CoreExprWithFVs | |||||||||||||||||||||||||||||||||||||||
Annotate a CoreExpr with its (non-global) free type and value variables at every tree node | |||||||||||||||||||||||||||||||||||||||
freeVarsOf :: CoreExprWithFVs -> IdSet | |||||||||||||||||||||||||||||||||||||||
Inverse function to freeVars | |||||||||||||||||||||||||||||||||||||||
Produced by Haddock version 2.7.2 |