Skip to content

Allow banning (or warning on) uses of implicit lifting in TH quotes

(This is a low-effort alternative to a GHC proposal, but it would definitely need one.)

One of the things that makes the behaviour of TH a bit magical is the implicit insertion of lift. lift is a rather non-trivial operation:

  • It converts a Haskell value into syntax (it's not necessarily obvious to a user this is even possible!)
  • It transfers values across stages

It would be nice to have the option of not having implicit lifting. This could be followed by a longer-term argument that no implicit lifting should be the default.

Concretely:

  • A language extension ImplicitTemplateHaskellLifting (and hence its inverse NoImplicitTemplateHaskellLifting
  • A warning -Wimplicit-template-haskell-lifting which warns when it is used (unsure if this is useful)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information