Add test cases for #7503, #14451
[ghc.git] / testsuite / tests / typecheck / should_compile / T14451.hs
1 {-# Language KindSignatures, TypeOperators, PolyKinds, TypeOperators, ConstraintKinds, TypeFamilies, DataKinds, TypeInType, GADTs, AllowAmbiguousTypes, InstanceSigs, RankNTypes, UndecidableInstances #-}
2 module T14451 where
3
4 import Data.Kind
5
6 data TyFun :: Type -> Type -> Type
7
8 type a ~> b = TyFun a b -> Type
9
10 type Cat ob = ob -> ob -> Type
11
12 type family
13 Apply (f :: a ~> b) (x :: a) :: b where
14 Apply (CompSym2 f g) a = Comp f g a
15
16 data CompSym2 :: (b ~> c) -> (a ~> b) -> (a ~> c)
17
18 type a·b = Apply a b
19
20 class Varpi (f :: i ~> j) where
21 type Dom (f :: i ~> j) :: Cat i
22 type Cod (f :: i ~> j) :: Cat j
23
24 varpa :: Dom f a a' -> Cod f (f·a) (f·a')
25
26 type family
27 Comp (f::k1 ~> k) (g::k2 ~> k1) (a::k2) :: k where
28 Comp f g a = f · (g · a)