News for hackers. Stuff that matters.
Re:What is the advantage of currying? by groue on Saturday February 02, 2013 @11:05AM (#5156278)
Another perspective of currying, from a guy that is not versed in functional programming.

I have written an expression evaluation engine whose internal implementation only manipulates functions that have a single argument. Merely value transformers.

It used to only interpret expressions like `f(x)`, `g(f(x))`. Later, functions were able to return other functions, and `f(x)(y)` was allowed. However, this last expression really looks like it would be better written `f(x,y)`. Why force the user to use a convoluted curried syntax such as `f(x)(y)` for his two-parameter function?

So the `f(x,y)` form has been added as a mere syntactic sugar. However the guts of the engine are still made of single-argument functions. That can get curried.

So currying is not only a tool for the end-user. It's also a tool for the language implementor :-)

There are no comments on this comment yet.