Repository : ssh://darcs.haskell.org//srv/darcs/testsuite On branch : master
http://hackage.haskell.org/trac/ghc/changeset/2f9e8f3072921e1cfe7ed83445848e91573dda56 >--------------------------------------------------------------- commit 2f9e8f3072921e1cfe7ed83445848e91573dda56 Author: Simon Peyton Jones <[email protected]> Date: Tue Apr 24 17:04:05 2012 +0100 Test Trac #6035, #6036 >--------------------------------------------------------------- tests/polykinds/T6035.hs | 28 ++++++++++++++++++++++++++++ tests/polykinds/T6036.hs | 17 +++++++++++++++++ 2 files changed, 45 insertions(+), 0 deletions(-) diff --git a/tests/polykinds/T6035.hs b/tests/polykinds/T6035.hs new file mode 100644 index 0000000..c9e4342 --- /dev/null +++ b/tests/polykinds/T6035.hs @@ -0,0 +1,28 @@ +{-# LANGUAGE PolyKinds, DataKinds, TypeFamilies, KindSignatures, GADTs, TypeOperators + #-} + +module T6035 where + +data Nat = Zero | Succ Nat + +type family Sing (a :: k) :: k -> * + +data SNat n where + SZero :: SNat Zero + SSucc :: SNat n -> SNat (Succ n) + +data SList (a :: [k]) where + SNil :: SList '[] + SCons :: Sing h h -> SList t -> SList (h ': t) + +type instance Sing (a :: Nat) = SNat +type instance Sing (a :: [k]) = SList + +nil :: SList '[] +nil = SNil + +zero :: SList '[ '[] ] +zero = SCons SNil SNil + +term :: SList '[ '[Zero], '[]] +term = SCons (SCons SZero SNil) (SCons SNil SNil) diff --git a/tests/polykinds/T6036.hs b/tests/polykinds/T6036.hs new file mode 100644 index 0000000..4425c85 --- /dev/null +++ b/tests/polykinds/T6036.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE DataKinds, TypeFamilies, PolyKinds, GADTs #-} + +module T6036 where + +data family Sing (a :: k) + +data instance Sing (a :: Maybe k) where + SNothing :: Sing 'Nothing + SJust :: Sing b -> Sing ('Just b) + +data Nat = Zero | Succ Nat + +data instance Sing (a :: Nat) where + SZero :: Sing Zero + SSucc :: Sing n -> Sing (Succ n) + +term = SJust SZero _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
