summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc057.hs
blob: cc561b95b88e5734dc2821ce3f9185dd64e9f0eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module ShouldSucceed where

-- See also tcfail060.hs

class Eq' a where
 deq :: a -> a -> Bool

instance Eq' Int where
  deq x y = True

instance (Eq' a) => Eq' [a] where
   deq (a:as) (b:bs) = dand (f a b) (f as bs)

dand True True = True
dand x y = False

f :: Eq' a => a -> a -> Bool
f p q = dand (deq p q) (deq [1::Int] [2::Int])