summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_compile
diff options
context:
space:
mode:
authorAlec Theriault <alec.theriault@gmail.com>2019-04-17 08:07:52 -0700
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-04-18 22:52:25 -0400
commit57cf113302eee6068a1b10cba348f4b7de7faeae (patch)
tree3542f990a72d4f3f8bbdd8965e6b2a82d5ea9d75 /testsuite/tests/deriving/should_compile
parent5988f17a799ba3416bb6ed539ae65e1f3fd9f2c0 (diff)
downloadhaskell-57cf113302eee6068a1b10cba348f4b7de7faeae.tar.gz
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.
Diffstat (limited to 'testsuite/tests/deriving/should_compile')
-rw-r--r--testsuite/tests/deriving/should_compile/T14682.stderr20
-rw-r--r--testsuite/tests/deriving/should_compile/drv-empty-data.stderr1
2 files changed, 7 insertions, 14 deletions
diff --git a/testsuite/tests/deriving/should_compile/T14682.stderr b/testsuite/tests/deriving/should_compile/T14682.stderr
index 75e9030bc7..7656c9c3b8 100644
--- a/testsuite/tests/deriving/should_compile/T14682.stderr
+++ b/testsuite/tests/deriving/should_compile/T14682.stderr
@@ -13,13 +13,12 @@ Derived class instances:
instance Language.Haskell.TH.Syntax.Lift T14682.Foo where
Language.Haskell.TH.Syntax.lift (T14682.Foo a1 a2)
- = Language.Haskell.TH.Lib.Internal.appE
- (Language.Haskell.TH.Lib.Internal.appE
- (Language.Haskell.TH.Lib.Internal.conE
- (Language.Haskell.TH.Syntax.mkNameG_d "main" "T14682" "Foo"))
- (Language.Haskell.TH.Syntax.lift a1))
- (Language.Haskell.TH.Syntax.lift a2)
-
+ = [| T14682.Foo a1 a2 |]
+ pending(rn) [<a2, Language.Haskell.TH.Syntax.lift a2>,
+ <a1, Language.Haskell.TH.Syntax.lift a1>]
+ Language.Haskell.TH.Syntax.liftTyped (T14682.Foo a1 a2)
+ = [|| T14682.Foo a1 a2 ||]
+
instance Data.Data.Data T14682.Foo where
Data.Data.gfoldl k z (T14682.Foo a1 a2)
= ((z T14682.Foo `k` a1) `k` a2)
@@ -98,13 +97,6 @@ GHC.Show.Show [T14682.Foo]
==================== Filling in method body ====================
-Language.Haskell.TH.Syntax.Lift [T14682.Foo]
- Language.Haskell.TH.Syntax.liftTyped = Language.Haskell.TH.Syntax.$dmliftTyped
- @(T14682.Foo)
-
-
-
-==================== Filling in method body ====================
Data.Data.Data [T14682.Foo]
Data.Data.dataCast1 = Data.Data.$dmdataCast1 @(T14682.Foo)
diff --git a/testsuite/tests/deriving/should_compile/drv-empty-data.stderr b/testsuite/tests/deriving/should_compile/drv-empty-data.stderr
index 5baf6a6c6e..d6e4eee4b0 100644
--- a/testsuite/tests/deriving/should_compile/drv-empty-data.stderr
+++ b/testsuite/tests/deriving/should_compile/drv-empty-data.stderr
@@ -46,6 +46,7 @@ Derived class instances:
instance Language.Haskell.TH.Syntax.Lift
(DrvEmptyData.Void a) where
Language.Haskell.TH.Syntax.lift z = GHC.Base.pure (case z of)
+ Language.Haskell.TH.Syntax.liftTyped z = GHC.Base.pure (case z of)
DrvEmptyData.$tVoid :: Data.Data.DataType
DrvEmptyData.$tVoid = Data.Data.mkDataType "Void" []