[project @ 1997-07-26 22:48:58 by sof]
[ghc.git] / ghc / tests / typecheck / should_compile / tc057.hs
1 module ShouldSucceed where
2
3 -- See also tcfail060.hs
4
5 class Eq' a where
6 deq :: a -> a -> Bool
7
8 instance Eq' Int where
9 deq x y = True
10
11 instance (Eq' a) => Eq' [a] where
12 deq (a:as) (b:bs) = dand (f a b) (f as bs)
13
14 dand True True = True
15 dand x y = False
16
17 f :: Eq' a => a -> a -> Bool
18 f p q = dand (deq p q) (deq [1::Int] [2::Int])