blob: 646d05c38b362f7141fc2eb52cd6cd222775fdf4 (
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)
|