diff options
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/T2494-2.hs')
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T2494-2.hs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T2494-2.hs b/testsuite/tests/typecheck/should_compile/T2494-2.hs new file mode 100644 index 0000000000..7e3bfc146b --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T2494-2.hs @@ -0,0 +1,16 @@ +{-# LANGUAGE Rank2Types, ScopedTypeVariables #-} + +-- Trac #2494, should compile ok + +module Foo where + +foo :: (forall m. Monad m => Maybe (m a) -> Maybe (m a)) -> Maybe a -> Maybe a +foo _ x = x + +{-# RULES + +"foo/foo" + forall (f :: forall m. Monad m => Maybe (m a) -> Maybe (m a)) + (g :: forall m. Monad m => Maybe (m a) -> Maybe (m a)) x. + foo f (foo g x) = foo (f . g) x + #-} |