diff options
-rw-r--r-- | testsuite/tests/indexed-types/should_compile/T15352.hs | 31 | ||||
-rw-r--r-- | testsuite/tests/indexed-types/should_compile/all.T | 2 |
2 files changed, 33 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/T15352.hs b/testsuite/tests/indexed-types/should_compile/T15352.hs new file mode 100644 index 0000000000..d83512f085 --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T15352.hs @@ -0,0 +1,31 @@ +{-# LANGUAGE TypeInType #-} -- or PolyKinds +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE TypeFamilies #-} + +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 diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T index 3f2759132a..035c85d179 100644 --- a/testsuite/tests/indexed-types/should_compile/all.T +++ b/testsuite/tests/indexed-types/should_compile/all.T @@ -288,3 +288,5 @@ test('T15318', normal, compile, ['']) test('T15322', normal, compile, ['']) test('T15322a', normal, compile_fail, ['']) test('T15142', normal, compile, ['']) +test('T15352', normal, compile, ['']) + |