Remove the type-checking knot.
[ghc.git] / testsuite / tests / polykinds / T5862.hs
1 {-# LANGUAGE PolyKinds,
2 TypeFamilies,
3 GADTs,
4 DataKinds,
5 KindSignatures
6 #-}
7
8 module T5862 where
9
10 data Nat = Zero | Succ Nat
11
12 data SNat a where
13 SZero :: SNat 'Zero
14 SSucc :: SNat n -> SNat ('Succ n)
15
16 data SBool a where
17 SFalse :: SBool 'False
18 STrue :: SBool 'True
19
20 data SMaybe a where
21 SNothing :: SMaybe 'Nothing
22 SJust :: Sing a -> SMaybe ('Just a)
23
24 type family Sing (a :: k)
25 type instance Sing (a :: Nat) = SNat a
26 type instance Sing (a :: Bool) = SBool a
27 type instance Sing (a :: Maybe *) = SMaybe a -- want to say Maybe k