diff options
Diffstat (limited to 'testsuite/tests/deriving/should_compile/drv015.hs')
-rw-r--r-- | testsuite/tests/deriving/should_compile/drv015.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_compile/drv015.hs b/testsuite/tests/deriving/should_compile/drv015.hs new file mode 100644 index 0000000000..f8cfbce2db --- /dev/null +++ b/testsuite/tests/deriving/should_compile/drv015.hs @@ -0,0 +1,14 @@ + +-- July 07: I'm changing this from "should_compile" to "should_fail". +-- It would generate an instance decl like +-- insance (Show (f a), Show (g a)) => Show (Pair1 f g a) +-- and that is not Haskell 98. +-- +-- See Note [Exotic derived instance contexts] in TcSimplify. +-- The rule is simple: the context of a derived instance decl must +-- contain constraints of form (C tyvar) only, just as H98. + +module ShouldCompile where + +newtype Pair1 f g a = Pair1 {unPair1 :: (f a, g a)} + deriving (Eq, Ord, Show) |