基本函数调用中的括号

对于 C 风格的函数调用,例如

plus(a, b); // Parentheses surrounding only the arguments, comma separated

然后是等效的 Haskell 代码

(plus a b) -- Parentheses surrounding the function and the arguments, no commas

在 Haskell 中,括号不是函数应用程序明确需要的,仅用于消除表达式的歧义,如数学中; 因此,如果括号括在表达式中的所有文本中,则实际上不需要括号,以下内容也是等效的:

plus a b -- no parentheses are needed here!

重要的是要记住,在 C 风格的语言中,功能