我有这两个表达式:
foldr (-) 0 . map (uncurry (*)) $ coords 5 7
foldr (-) 0 . map (uncurry (*)) (coords 5 7)
的(1)作品打印出来的结果,但(2)有错误说:
<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)
任何人都可以告诉我这两者有什么区别?谢谢。
我现在看到,谢谢,我想知道为什么(uncurry(*)))作为参数与()不会导致问题,但最后一个参数(坐标5 7)呢?和顺便说一句,如果表达式中有多个$?口译员会如何解释这个表达? – linjunshi