Function Application is not Currying

Kaz Kylheku kkylheku at gmail.com
Wed Jan 28 20:49:25 EST 2009


On 2009-01-28, Xah Lee <xahlee at gmail.com> wrote:
> Function Application is not Currying

That's correct, Xah. Currying is a special case of function application. 
A currying function is applied to some other function, and returns function
that has fewer arguments.

In some languages, you don't see the currying function. It's invisibly
performed whenever you forget an argument. Hit a three argument function with
only two arguments, and you don't get a nice ``insufficient arguments in
function call'' error, but the call is diverted to the currying function, which
gives you back a function of one argument, which you can then call with the
missing argument to compute the original function.

> Xah Lee, 2009-01-28
>
> In Jon Harrop's book Ocaml for Scientist at
> http://www.ffconsultancy.com/products/ocaml_for_scientists/chapter1.html

Figures you'd be reading this. Learning anything?

> It says:
>
>     Currying
>
>     A curried function is a function which returns a function as its
> result.
>
> LOL. That is incorrect.

Yawn. Say it isn't so.



More information about the Python-list mailing list