SCC analysis for instances as well as types/classes
[ghc.git] / testsuite / tests / typecheck / should_compile / T2494-2.hs
1 {-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
2
3 -- Trac #2494, should compile ok
4
5 module Foo where
6
7 foo :: (forall m. Monad m => Maybe (m a) -> Maybe (m a)) -> Maybe a -> Maybe a
8 {-# NOINLINE [1] foo #-}
9 foo _ x = x
10
11 {-# RULES
12
13 "foo/foo"
14 forall (f :: forall m. Monad m => Maybe (m a) -> Maybe (m a))
15 (g :: forall m. Monad m => Maybe (m a) -> Maybe (m a)) x.
16 foo f (foo g x) = foo (f . g) x
17 #-}