I’m confused

Learn You a Haskell for Great Good! : Error in example at p.84

I get the following error when I try the example at p.83 of "Learn You a Haskell for Great Good!":
Prelude> (sum . replicate 5) max 6.7 8.9

:2:2:
No instance for (Num (a0 -> a0 -> a0))
arising from a use of `sum'
Possible fix:
add an instance declaration for (Num (a0 -> a0 -> a0))
In the first argument of `(.)', namely `sum'
In the expression: sum . replicate 5
In the expression: (sum . replicate 5) max 6.7 8.9

The example "sum . replicate 5 $ max 6.7 8.9" works without any problems.
1 person has
this question
+1
Reply