Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
C9 Lectures: Dr. Erik Meijer - Functional Programming Fundamentals, Chapter 3 of 13
Oct 16, 2009 at 1:18 PMI 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" ?