Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为什么我不能做类似的事情
let sum = List.fold + 0 aListOfNumbers
因为如果你这样写,F# 会认为你试图调用+withList.fold作为它的左参数和0 aListOfNumbers右参数。
+
List.fold
0 aListOfNumbers
要将中缀运算符作为函数的参数,您需要将其括起来:
let sum = List.fold (+) 0 aListOfNumbers