I loaded an haskell file with following code on hugs:
double x = x + x
quad x = double (double x)
quadrup = double . double
If I try "quad 1.01" (without quotes), the correct result of 4.04 is returned but if I try "quadrup 1.01" (without quotes) hugs returns following error message.
ERROR - Cannot infer instance
*** Instance : Fractional Integer
*** Expression : quadrup 1.01
Hugs returns the following types for quad and quadrup.
Main> :type quad
quad :: Num a => a -> a
Main> :type quadrup
quadrup :: Integer -> Integer
Why does quadrup end up with type of Integer -> Integer instead of "Num a => a -> a" ?