I have these two expressions:
foldr (-) 0 . map (uncurry (*)) $ coords 5 7
foldr (-) 0 . map (uncurry (*)) (coords 5 7)
The (1) works print out the result, but (2) have error says:
<interactive>:50:15:
Couldn't match expected type ‘a -> t0 c’
with actual type ‘[Integer]’
Relevant bindings include
it :: a -> c (bound at <interactive>:50:1)
Possible cause: ‘map’ is applied to too many arguments
In the second argument of ‘(.)’, namely
‘map (uncurry (*)) (coords 5 7)’
In the expression: foldr (-) 0 . map (uncurry (*)) (coords 5 7)
Can any one tell me what's the difference between these two? Thanks.