summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_run/cgrun027.hs
blob: bf3183e5097ef861d8c82dcfc180a824e86035a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
-- !!! simple test of 0-method classes
--

class (Num a, Integral a) => Foo a

main = putStr (shows (f ((fromInteger 21)::Int)
                        ((fromInteger 37))) "\n")

instance Foo Int

f :: Foo a => a -> a -> Integer

f a b = toInteger (a + b)