HORIZON HASKELLDocslts/ghc-9.14.xb2f3bfd2026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · b2f3bfd · 2026-10-11

Moduleghc-lib-parser-9.14.1.20251220GHC2021

GHC.Core.FVs

A module concerned with finding the free variables of an expression.

  • 6 types
  • 46 values

Free variables of expressions and binding groups

12 declarations
valueexprFreeVars :: CoreExpr -> VarSet
#

Find all locally-defined free Ids or type variables in an expression returning a non-deterministic set.

valueexprsFreeVars :: [CoreExpr] -> VarSet
#

Find all locally-defined free Ids or type variables in several expressions returning a non-deterministic set.

valueexprFreeVarsList :: CoreExpr -> [Var]
#

Find all locally-defined free Ids or type variables in an expression returning a deterministically ordered list.

valueexprsFreeVarsList :: [CoreExpr] -> [Var]
#

Find all locally-defined free Ids or type variables in several expressions returning a deterministically ordered list.

valueexprFreeIdsList :: CoreExpr -> [Id]
#

Find all locally-defined free Ids in an expression returning a deterministically ordered list.

valueexprsFreeIdsList :: [CoreExpr] -> [Id]
#

Find all locally-defined free Ids in several expressions returning a deterministically ordered list.

Selective free variables of expressions

5 declarations
typetype InterestingVarFun = Var -> Bool
#

Predicate on possible free variables: returns True iff the variable is interesting

Free variables of Rules, Vars and Ids

22 declarations
valueruleFreeVars :: CoreRule -> VarSet
#

Those variables free in the both the left right hand sides of a rule returned as a non-deterministic set

This finds all locally-defined free Ids on the left hand side of a rule and returns them as a non-deterministic set

valueruleLhsFreeIdsList :: CoreRule -> [Var]
#

This finds all locally-defined free Ids on the left hand side of a rule and returns them as a deterministically ordered list

valueexprLocalFVs :: CoreExpr -> FV
#

Find all locally-defined free Ids or type variables in an expression returning a composable FV computation. See Note [FV naming conventions] in GHC.Utils.FV for why export it.

Orphan names

4 declarations

orphNamesOfAxiomLHS collects the names of the concrete types and type constructors that make up the LHS of a type family instance, including the family name itself.

For instance, given `type family Foo a b`: `type instance Foo (F (G (H a))) b = ...` would yield [Foo,F,G,H]

Used (via orphNamesOfFamInst) in the implementation of ":info" in GHCi. and when determining orphan-hood for a FamInst or module

Core syntax tree annotation with free variables

9 declarations

Every node in an expression annotated with its (non-global) free variables, both Ids and TyVars, and type. NB: see Note [The FVAnn invariant]

Every node in a binding group annotated with its (non-global) free variables, both Ids and TyVars, and type.

typetype CoreAltWithFVs = AnnAlt Id FVAnn
#

Every node in an expression annotated with its (non-global) free variables, both Ids and TyVars, and type.