Embrace -XTypeInType, add -XStarIsType
[ghc.git] / testsuite / tests / dependent / should_compile / T14991.hs
1 {-# LANGUAGE TypeFamilies #-}
2 {-# LANGUAGE DataKinds #-}
3 {-# LANGUAGE PolyKinds #-}
4 {-# LANGUAGE TypeOperators #-}
5 {-# LANGUAGE UndecidableInstances #-}
6 module T14991 where
7
8 import Data.Kind
9
10 type family Promote (k :: Type) :: Type
11 type family PromoteX (a :: k) :: Promote k
12
13 type family Demote (k :: Type) :: Type
14 type family DemoteX (a :: k) :: Demote k
15
16 -----
17 -- Type
18 -----
19
20 type instance Demote Type = Type
21 type instance Promote Type = Type
22
23 type instance DemoteX (a :: Type) = Demote a
24 type instance PromoteX (a :: Type) = Promote a
25
26 -----
27 -- Arrows
28 -----
29
30 data TyFun :: Type -> Type -> Type
31 type a ~> b = TyFun a b -> Type
32 infixr 0 ~>
33
34 type instance Demote (a ~> b) = DemoteX a -> DemoteX b
35 type instance Promote (a -> b) = PromoteX a ~> PromoteX b