TH: make `Lift` and `TExp` levity-polymorphic
Besides the obvious benefits of being able to manipulate TExp
's of
unboxed types, this also simplified -XDeriveLift
all while making
it more capable.
-
ghc-prim
is explicitly depended upon bytemplate-haskell
-
The following TH things are parametrized over
RuntimeRep
:TExp(..)
unTypeQ
unsafeTExpCoerce
Lift(..)
-
The following instances have been added to
Lift
:-
Int#
,Word#
,Float#
,Double#
,Char#
,Addr#
- unboxed tuples of lifted types up to arity 7
- unboxed sums of lifted types up to arity 7
Ideally we would have levity-polymorphic instances of unboxed tuples and sums.
-
-
The code generated by
-XDeriveLift
uses expression quotes instead of generating large amounts of TH code and having special hard-coded cases for some unboxed types.
This implements GHC proposal 47.
Fixes #16384 (closed).