HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Moduleghc-lib-parser-9.14.1.20251220GHC2021

GHC.Utils.FV

Utilities for efficiently and deterministically computing free variables.

Contents
  1. Deterministic free vars computations
  2. Running the computations
  3. Manipulating those computations
Synopsis

Deterministic free vars computations

Running the computations

valuefvVarList :: FV -> [Var]

Run a free variable computation, returning a list of distinct free variables in deterministic order.

valuefvVarSet :: FV -> VarSet

Run a free variable computation, returning a non-deterministic set of free variables. Don't use if the set will be later converted to a list and the order of that list will impact the generated code.

valuefvDVarSet :: FV -> DVarSet

Run a free variable computation, returning a deterministic set of free variables. Note that this is just a wrapper around the version that returns a deterministic list. If you need a list you should use fvVarList.

Manipulating those computations

valueunitFV :: Id -> FV

Add a variable - when free, to the returned free variables. Ignores duplicates and respects the filtering function.

valuemkFVs :: [Var] -> FV

Add multiple variables - when free, to the returned free variables. Ignores duplicates and respects the filtering function.

valuemapUnionFV :: (a -> FV) -> [a] -> FV

Map a free variable computation over a list and union the results.