Remove the type-checking knot.
[ghc.git] / testsuite / tests / polykinds / T6118.hs
1 {-# LANGUAGE PolyKinds, DataKinds, KindSignatures, RankNTypes,
2 TypeFamilies, FlexibleInstances, UndecidableInstances #-}
3
4 module T6118 where
5
6 import GHC.Exts
7
8 data Nat = Zero | Succ Nat
9 data List a = Nil | Cons a (List a)
10
11 class SingE (a :: k) where
12 type Demote a :: *
13
14 instance SingE (a :: Bool) where
15 type Demote a = Bool
16 instance SingE (a :: Nat) where
17 type Demote a = Nat
18
19 instance SingE (a :: Maybe k) where
20 type Demote (a :: Maybe k) = Maybe (Demote (Any :: k))
21
22 instance SingE (a :: List k) where
23 type Demote (a :: List k) = List (Demote (Any :: k))