projects
/
ghc-hetmet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
e8efca4105cb1e97f1fd46b834cdf98f9a0732cd
[ghc-hetmet.git]
/
ghc
/
tests
/
codeGen
/
should_run
/
cg011.hs
1
--!!! simple overloading example
2
3
class Foo a where
4
foo :: a -> a -> Bool
5
6
class (Foo a) => Bar a where
7
bar :: a -> a -> Bool
8
9
instance Foo Int where
10
foo a b = a /= b
11
12
instance Foo Bool where
13
foo a b = a /= b
14
15
instance Bar Int where
16
bar a b = a < b
17
18
instance Bar Bool where
19
bar a b = a < b
20
21
foO = if bar (2::Int) (3::Int) then
22
if bar False True then
23
(42::Int)
24
else
25
(888::Int)
26
else
27
(999::Int)
28
29
main = print foO