summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_run/cgrun011.hs
blob: c687e50272113728e6b2ffbf6d511203edb8e89b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-- !!! simple overloading example

class Foo a where
    foo :: a -> a -> Bool

class (Foo a) => Bar a where
    bar :: a -> a -> Bool

instance Foo Int where
    foo a b = a /= b

instance Foo Bool where
    foo a b = a /= b

instance Bar Int where
    bar a b = a < b

instance Bar Bool where
    bar a b = a < b

foO = if bar (2::Int) (3::Int) then
	    if bar False True then
	    	(42::Int)
	    else
		(888::Int)
       else
	  (999::Int)

main = print foO