I was wondering if someone could explain this error? I typed in the sample code from the Haskell Beginning Wikibook to define a function for absolute value. I have GHC 7.0.4 for OSX. The error went away when I put parentheses around the negative value, so did the Haskell interpreter think I was entering - and a second argument, namely 10, when the parentheses weren't there? Thank you!
*Main> let abs x = if x < 0 then -x else x*Main> abs 55*Main> abs -10
And got the following error<interactive>:1:6:No instance for (Num (a0 -> a0))arising from the literal `10'Possible fix: add an instance declaration for (Num (a0 -> a0))In the second argument of `(-)', namely `10'In the expression: abs - 10In an equation for `it': it = abs - 10
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners