summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/quantified-constraints/T21037.hs24
-rw-r--r--testsuite/tests/quantified-constraints/all.T1
2 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/quantified-constraints/T21037.hs b/testsuite/tests/quantified-constraints/T21037.hs
new file mode 100644
index 0000000000..8fa4a6ca09
--- /dev/null
+++ b/testsuite/tests/quantified-constraints/T21037.hs
@@ -0,0 +1,24 @@
+{-# LANGUAGE QuantifiedConstraints #-}
+
+module T21037 where
+
+type f ~> g = forall x. f x -> g x
+
+class (forall f. Functor f => Functor (h f)) => HFunctor h where
+ hmap :: (f ~> g) -> (h f ~> h g)
+
+class (forall m. Monad m => Monad (h m), HFunctor h) => HMonad h where
+ hreturn :: Monad m => m ~> h m
+ hdnib :: (Monad m, Monad n) => (m ~> h n) -> h m ~> h n
+
+bar :: (HMonad h, Monad f) => (Functor (h f) => c) -> c
+bar x = x
+
+baz ::
+ ( forall m. Monad m => Monad (h m),
+ forall f. Functor f => Functor (h f),
+ Monad f
+ ) =>
+ (Functor (h f) => c) ->
+ c
+baz x = x
diff --git a/testsuite/tests/quantified-constraints/all.T b/testsuite/tests/quantified-constraints/all.T
index d055adc848..00d66e55a8 100644
--- a/testsuite/tests/quantified-constraints/all.T
+++ b/testsuite/tests/quantified-constraints/all.T
@@ -33,3 +33,4 @@ test('T18432', normal, compile, [''])
test('T19921', normal, compile_fail, [''])
test('T16474', normal, compile_fail, [''])
test('T21006', normal, compile_fail, [''])
+test('T21037', normal, compile, [''])