Remove the type-checking knot.
[ghc.git] / testsuite / tests / polykinds / T11480a.hs
1 {-# language KindSignatures, PolyKinds, TypeFamilies,
2 NoImplicitPrelude, FlexibleContexts,
3 MultiParamTypeClasses, GADTs,
4 ConstraintKinds, FlexibleInstances, UndecidableInstances,
5 FunctionalDependencies, UndecidableSuperClasses #-}
6
7 module T11480a where
8
9 import GHC.Types (Constraint)
10 import qualified Prelude
11
12 data Nat (c :: i -> i -> *) (d :: j -> j -> *) (f :: i -> j) (g :: i -> j)
13
14 class Functor p (Nat p (->)) p => Category (p :: i -> i -> *)
15
16 class (Category dom, Category cod)
17 => Functor (dom :: i -> i -> *) (cod :: j -> j -> *) (f :: i -> j)
18 | f -> dom cod
19
20 instance (Category c, Category d) => Category (Nat c d)
21 instance (Category c, Category d) => Functor (Nat c d) (Nat (Nat c d) (->)) (Nat c d)
22 instance (Category c, Category d) => Functor (Nat c d) (->) (Nat c d f)
23
24 instance Category (->)
25 instance Functor (->) (->) ((->) e)
26 instance Functor (->) (Nat (->) (->)) (->)