summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_compile/T15352.hs
blob: 0bb4a2bc63e0f3a73eba6dd377c559afaf48004c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE TypeInType #-} -- or PolyKinds
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}

module T15352 where

import Data.Kind

class C (x :: Type) (y :: k) where
  type F y


type Hom k = k -> k -> Type

type family Ob (p :: Hom k) :: k -> Constraint

class ( obP ~ Ob p
      , opP ~ Dom p
      , obQ ~ Ob q
      , opQ ~ Dom q
      , p ~ Dom f
      , q ~ Cod f
      ) => Functor' (obP :: i -> Constraint)
                    (opP :: Hom i)
                    (p :: Hom i)
                    (obQ :: j -> Constraint)
                    (opQ :: Hom j)
                    (q :: Hom j)
                    (f :: i -> j) where
  type Dom f :: Hom i
  type Cod f :: Hom j