Repository : ssh://darcs.haskell.org//srv/darcs/testsuite On branch : master
http://hackage.haskell.org/trac/ghc/changeset/00e79a0387803c3e8a87e966ef18d86ead1fe763 >--------------------------------------------------------------- commit 00e79a0387803c3e8a87e966ef18d86ead1fe763 Author: Jose Pedro Magalhaes <[email protected]> Date: Thu Jun 21 12:49:44 2012 +0100 Add one of Reiner Pope's tests for #5936 >--------------------------------------------------------------- tests/generics/GEq/GEq1.hs | 14 ++++++++++++-- tests/generics/GEq/GEq1.stdout | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/generics/GEq/GEq1.hs b/tests/generics/GEq/GEq1.hs index 01dedec..164535c 100644 --- a/tests/generics/GEq/GEq1.hs +++ b/tests/generics/GEq/GEq1.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE TypeOperators, DeriveGeneric #-} +{-# LANGUAGE TypeOperators, DeriveGeneric, TypeFamilies, FlexibleInstances #-} module Main where @@ -16,6 +16,10 @@ data D a = D0 | D1 { d11 :: a, d12 :: (D a) } data (:**:) a b = a :**: b deriving Generic +data family F a b :: * -> * +data instance F Int b c = F b Int c + deriving Generic + -- Example values c0 = C0 c1 = C1 @@ -27,15 +31,21 @@ d1 = D1 'p' D0 p1 :: Int :**: Char p1 = 3 :**: 'p' +f1 :: F Int Float Char +f1 = F 0.0 3 'h' +f2 = F 0.0 4 'h' + -- Generic instances instance GEq C instance (GEq a) => GEq (D a) instance (GEq a, GEq b) => GEq (a :**: b) +instance (GEq b, GEq c) => GEq (F Int b c) -- Tests teq0 = geq c0 c1 teq1 = geq d0 d1 teq2 = geq d0 d0 teq3 = geq p1 p1 +teq4 = geq f1 f2 -main = mapM_ print [teq0, teq1, teq2, teq3] +main = mapM_ print [teq0, teq1, teq2, teq3, teq4] diff --git a/tests/generics/GEq/GEq1.stdout b/tests/generics/GEq/GEq1.stdout index a7f0546..3ce45b8 100644 --- a/tests/generics/GEq/GEq1.stdout +++ b/tests/generics/GEq/GEq1.stdout @@ -2,3 +2,4 @@ False False True True +False _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
