SCC analysis for instances as well as types/classes
[ghc.git] / testsuite / tests / typecheck / should_compile / tc059.hs
1 module ShouldSucceed where
2
3 class Eq2 a where
4 deq :: a -> a -> Bool
5 foo :: a -> a
6
7 instance Eq2 Int where
8 deq x y = True
9 foo x = x
10
11 instance (Eq2 a) => Eq2 [a] where
12 deq (a:as) (b:bs) = if (deq a (foo b)) then (deq as (foo bs)) else False
13 foo x = x
14
15 f x = deq x [1]