HORIZON HASKELLDocslts/ghc-9.14.x7a6c33e2026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 7a6c33e · 2026-10-12

Moduleghc-9.14.1GHC2021

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
  • Packageghc-9.14.1
  • Exports15
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceFV.hs

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.