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