diff options
Diffstat (limited to 'testsuite/tests/indexed-types/should_compile/Ind2_help.hs')
-rw-r--r-- | testsuite/tests/indexed-types/should_compile/Ind2_help.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/Ind2_help.hs b/testsuite/tests/indexed-types/should_compile/Ind2_help.hs new file mode 100644 index 0000000000..b088302fec --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/Ind2_help.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE TypeFamilies #-} + +module Ind2_help where + +class C a where + data T a :: * + unT :: T a -> a + mkT :: a -> T a + +instance (C a, C b) => C (a,b) where + data T (a,b) = TProd (T a) (T b) + unT (TProd x y) = (unT x, unT y) + mkT (x,y) = TProd (mkT x) (mkT y) + |