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

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

Moduleghc-lib-parser-9.14.1.20251220GHC2021

GHC.Types.Var.Set

  • 10 types
  • 65 values

Var, Id and TyVar set types

5 declarations
typetype VarSet = UniqSet Var
#

A non-deterministic Variable Set

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

valuepluralVarSet :: VarSet -> SDoc
#

Determines the pluralisation suffix appropriate for the length of a set in the same way that plural from Outputable does for lists.

valuepprVarSet
  1. :: VarSet

    The things to be pretty printed

  2. -> ([Var] -> SDoc)

    The pretty printing function to use on the elements

  3. -> SDoc

    SDoc where the things have been pretty printed

#

Pretty-print a non-deterministic set. The order of variables is non-deterministic and for pretty-printing that shouldn't be a problem. Having this function helps contain the non-determinism created with nonDetEltsUFM. Passing a list to the pretty-printing function allows the caller to decide on the order of Vars (eg. toposort them) without them having to use nonDetEltsUFM at the call site. This prevents from let-binding non-deterministically ordered lists and reusing them where determinism matters.

Deterministic Var set types

5 declarations

Manipulating these sets