[Haskell-cafe] a simple question about types
jerzmy at gmail.com
Wed Nov 17 13:09:16 EST 2010
let me take this simple function: (2*).
If I check its type
(2*) :: (Num a) => a -> a
But now it suffices to write
g = (2*)
g :: Integer -> Integer
One more combination, now I write
h x = (2*) x
and check once more
h :: (Num a) => a -> a
So my question is: why (in this second example) Integer is inferred?
What makes a difference?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe