summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_compile/T15352.hs
blob: 802f42e898f09d1ac5c0139046ecd8423bd6f47d (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 PolyKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE StandaloneKindSignatures #-}

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

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