Skip to content

Make the Template Haskell class Lift work over typed expressions

At the moment we have the Lift class in TH:

class Lift t where
  lift :: t -> Q Exp

But that loses type information. What we want is this:

Lift t where
  typedLift :: t -> Q (TExp t)

lift :: Lift t => t -> Q Exp
lift = fmap unType . typedLift

Otherwise, when you want the typed version, people resort to unsafe-coerce operations, which are entirely unnecessary.

See this thread on the libraries list.

Trac metadata
Trac field Value
Version 8.2.2
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Template Haskell
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information