HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleth-expand-syns-0.4.12.0Haskell2010

Language.Haskell.TH.ExpandSyns

  • 1 type
  • 7 values

Expand synonyms

4 declarations

Misc utilities

4 declarations
valueevades :: Data t => [Name] -> t -> [Name]
#

Make a list of names (based on the first arg) such that every name in the result is distinct from every name in the second arg, and from the other results

valueevade :: Data d => Name -> d -> Name
#

Make a name (based on the first arg) that's distinct from every name in the second arg

Example why this is necessary:

type E x = forall y. Either x y

... expandSyns [t| forall y. y -> E y |]

The example as given may actually work correctly without any special capture-avoidance depending on how GHC handles the ys, but in any case, the input type to expandSyns may be an explicit AST using mkName to ensure a collision.