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

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

Moduleth-expand-syns-0.4.12.0Haskell2010

Language.Haskell.TH.ExpandSyns

Contents
  1. Expand synonyms
  2. Misc utilities
Synopsis

Expand synonyms

Misc utilities

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.