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

class Foo a where
 o_and :: a -> a -> a


instance Foo Bool where
 o_and False x = False
 o_and x False = False
 o_and True True = True


instance Foo Int where
 o_and x 0 = 0
 o_and 0 x = 0
 o_and 1 1 = 1


f x y = o_and x False

g x y = o_and x 1