News for hackers. Stuff that matters.
Re:Currying vs. Partial Application (2015) by catnaroek on Tuesday September 19, 2017 @10:08AM (#15284700)
Just to be clear, I don't advocate currying everywhere. To me, the distinction between uncurried and curried functions lies primarily in the kinds of usage they suggest:

(0) Uncurried functions are easier to pass as arguments to higher-order functions, because the author of the latter doesn't have to anticipate the arity of the former.

(1) Curried functions are easier to partially apply. This is particularly useful for collection-traversing higher-order functions (map, filter, reduce, etc.).

Furthermore, functions of three or more arguments can be “partially curried” in various ways, and the optimal choice ultimately depends on how you intend to use them.

That being said, when in doubt, I tend to go for uncurried.

There are no comments on this comment yet.