Embrace -XTypeInType, add -XStarIsType
[ghc.git] / testsuite / tests / dependent / should_compile / Rae31.hs
1 {-# LANGUAGE TemplateHaskell, TypeOperators, PolyKinds, DataKinds,
2 TypeFamilies #-}
3
4 module A where
5
6 import Data.Kind
7
8 data family Sing (k :: Type) :: k -> Type
9 type Sing' (x :: k) = Sing k x
10 data TyFun' (a :: Type) (b :: Type) :: Type
11 type TyFun (a :: Type) (b :: Type) = TyFun' a b -> Type
12 type family (a :: TyFun k1 k2) @@ (b :: k1) :: k2
13 data TyPi' (a :: Type) (b :: TyFun a Type) :: Type
14 type TyPi (a :: Type) (b :: TyFun a Type) = TyPi' a b -> Type
15 type family (a :: TyPi k1 k2) @@@ (b :: k1) :: k2 @@ b
16 $(return [])
17
18 data A (a :: Type) (b :: a) (c :: TyFun' a Type)
19 -- A :: forall a -> a -> a ~> Type
20 type instance (@@) (A a b) c = Type
21 $(return [])
22 data B (a :: Type) (b :: TyFun' a Type)
23 -- B :: forall a -> a ~> Type
24 type instance (@@) (B a) b = TyPi a (A a b)
25 $(return [])
26 data C (a :: Type) (b :: TyPi a (B a)) (c :: a) (d :: a)
27 (e :: TyFun' (b @@@ c @@@ d) Type)