Embrace -XTypeInType, add -XStarIsType
[ghc.git] / testsuite / tests / indexed-types / should_compile / T14554.hs
1 {-# Language UndecidableInstances, DataKinds, TypeOperators, TypeFamilies,
2 PolyKinds, GADTs, LambdaCase, ScopedTypeVariables #-}
3
4 module T14554 where
5
6 import Data.Kind
7 import Data.Proxy
8
9 type a ~> b = (a, b) -> Type
10
11 data IdSym0 :: (Type,Type) -> Type
12
13 data KIND = X | FNARR KIND KIND
14
15 data TY :: KIND -> Type where
16 ID :: TY (FNARR X X)
17 FNAPP :: TY (FNARR k k') -> TY k -> TY k'
18
19 data TyRep (kind::KIND) :: TY kind -> Type where
20 TID :: TyRep (FNARR X X) ID
21 TFnApp :: TyRep (FNARR k k') f
22 -> TyRep k a
23 -> TyRep k' (FNAPP f a)
24
25 type family IK (kind::KIND) :: Type where
26 IK X = Type
27 IK (FNARR k k') = IK k ~> IK k'
28
29 type family IT (ty::TY kind) :: IK kind
30
31 zero :: TyRep X a -> IT a
32 zero x = case x of
33 TFnApp TID a -> undefined