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 by `template-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.
Showing
- compiler/prelude/THNames.hs 7 additions, 4 deletionscompiler/prelude/THNames.hs
- compiler/typecheck/Inst.hs 14 additions, 8 deletionscompiler/typecheck/Inst.hs
- compiler/typecheck/TcDeriv.hs 2 additions, 0 deletionscompiler/typecheck/TcDeriv.hs
- compiler/typecheck/TcDerivUtils.hs 6 additions, 4 deletionscompiler/typecheck/TcDerivUtils.hs
- compiler/typecheck/TcExpr.hs 8 additions, 6 deletionscompiler/typecheck/TcExpr.hs
- compiler/typecheck/TcGenDeriv.hs 18 additions, 63 deletionscompiler/typecheck/TcGenDeriv.hs
- compiler/typecheck/TcSplice.hs 6 additions, 3 deletionscompiler/typecheck/TcSplice.hs
- docs/users_guide/8.10.1-notes.rst 6 additions, 0 deletionsdocs/users_guide/8.10.1-notes.rst
- docs/users_guide/glasgow_exts.rst 12 additions, 20 deletionsdocs/users_guide/glasgow_exts.rst
- libraries/template-haskell/Language/Haskell/TH/Syntax.hs 214 additions, 16 deletionslibraries/template-haskell/Language/Haskell/TH/Syntax.hs
- libraries/template-haskell/changelog.md 4 additions, 1 deletionlibraries/template-haskell/changelog.md
- libraries/template-haskell/template-haskell.cabal.in 1 addition, 0 deletionslibraries/template-haskell/template-haskell.cabal.in
- testsuite/tests/deriving/should_compile/T14682.stderr 6 additions, 14 deletionstestsuite/tests/deriving/should_compile/T14682.stderr
- testsuite/tests/deriving/should_compile/drv-empty-data.stderr 1 addition, 0 deletions...suite/tests/deriving/should_compile/drv-empty-data.stderr
- testsuite/tests/quotes/TH_localname.stderr 1 addition, 11 deletionstestsuite/tests/quotes/TH_localname.stderr
Loading
Please register or sign in to comment