2 ms·
Haskell is more versatile: f(a, b) is a function applied to a single tuple, f a b is a function applied to two arguments. I do not understand the "instead of"
by nsytk 5y ago
Haskell is more versatile: f(a, b) is a function applied to a single tuple, f a b is a function applied to two arguments.
I do not understand the "instead of" in the cited part and it makes me somewhat skeptical (so does the "Py" in the name).
- ModernMech 5y agoIn Haskell, all functions take a single argument.
- HelloNurse 5y agoThis "mandatory" currying is an useful and elegant simplification compared to other languages, but in practical terms if we write f a b f has to work as a function of two arguments; that it is also formally interpretable, but not necessarily useful, as a function of one argument is only a nice bonus.
- faho 5y agoIn python, f(a, b) is a function applied to two arguments and f((a, b)) is a function applied to a single tuple.
- zgamy 5y agoBut is that closer to math notation as claimed in this thread? https://en.wikipedia.org/wiki/Argument_of_a_function https://en.wikipedia.org/wiki/Argument_of_a_function "For example, the binary function f(x, y) = x + y has two arguments, x and y, in an ordered pair (x, y)." So, function application to an ordered pair, i.e., a tuple, does not use double parentheses. Also, of course, currying in Python is atrocious.