summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/generics/GEq/Main.hs
diff options
context:
space:
mode:
authorJose Pedro Magalhaes <jpm@cs.uu.nl>2011-05-04 11:16:36 +0200
committerJose Pedro Magalhaes <jpm@cs.uu.nl>2011-05-04 11:16:36 +0200
commit26ea1e825cd07e3b179aa4a0b1ba615b4787404b (patch)
tree84c6b3d64f3802f7cd2857e508682d98368fc743 /testsuite/tests/ghc-regress/generics/GEq/Main.hs
parent92af81751072c7a18abf87173aa844432cbaa59f (diff)
downloadhaskell-26ea1e825cd07e3b179aa4a0b1ba615b4787404b.tar.gz
Adapt the testsuite to the recent ghc-generics changes.
Diffstat (limited to 'testsuite/tests/ghc-regress/generics/GEq/Main.hs')
-rw-r--r--testsuite/tests/ghc-regress/generics/GEq/Main.hs16
1 files changed, 13 insertions, 3 deletions
diff --git a/testsuite/tests/ghc-regress/generics/GEq/Main.hs b/testsuite/tests/ghc-regress/generics/GEq/Main.hs
index 7cb9f95b85..40e3d25a46 100644
--- a/testsuite/tests/ghc-regress/generics/GEq/Main.hs
+++ b/testsuite/tests/ghc-regress/generics/GEq/Main.hs
@@ -8,8 +8,13 @@ import GEq
-- We should be able to generate a generic representation for these types
data C = C0 | C1
+ deriving Representable0
data D a = D0 | D1 { d11 :: a, d12 :: (D a) }
+ deriving Representable0
+
+data (:**:) a b = a :**: b
+ deriving Representable0
-- Example values
c0 = C0
@@ -19,13 +24,18 @@ d0 :: D Char
d0 = D0
d1 = D1 'p' D0
+p1 :: Int :**: Char
+p1 = 3 :**: 'p'
+
-- Generic instances
-instance GEq C
-instance (GEq a) => GEq (D a)
+instance GEq C
+instance (GEq a) => GEq (D a)
+instance (GEq a, GEq b) => GEq (a :**: b)
-- Tests
teq0 = geq c0 c1
teq1 = geq d0 d1
teq2 = geq d0 d0
+teq3 = geq p1 p1
-main = mapM_ print [teq0, teq1, teq2]
+main = mapM_ print [teq0, teq1, teq2, teq3]