
17 Nov
2010
17 Nov
'10
1:09 p.m.
Hallo, let me take this simple function: (2*). If I check its type :t (2*) I'll obtain (2*) :: (Num a) => a -> a But now it suffices to write g = (2*) and check :t g to obtain g :: Integer -> Integer One more combination, now I write h x = (2*) x and check once more :t h to get h :: (Num a) => a -> a So my question is: why (in this second example) Integer is inferred? What makes a difference? Jerz