[plt-scheme] Why do layman programmers care about Currying?

From: Joe Marshall (jmarshall at alum.mit.edu)
Date: Wed Dec 31 18:29:34 EST 2008

On Tue, Dec 30, 2008 at 9:44 PM, Richard Cleis <rcleis at me.com> wrote:
> However, I am not certain that Currying refers to reducing the arguments in
> any order.  I have the impression that Currying literally means reducing
> them in the order that they appear so that other functions may be written to
> take advantage of such strictness.  Freeform reduction of arguments is
> simply making use of closures.  No?

I think that's an unnecessarily strict interpretation.  You can always
the order of the arguments so they curry conveniently, and you can
always de-curry
any contiguous subset.

Currying means to me taking an operation that operates on some base level
and `lifting' it up to operate on functions of the base level.  For example, the
familiar binary operations of +, -, * and / operate on numbers, but if
we curry them,
we get functions that map from numbers to functions that map to
numbers.  We take
the binary operator `+' and turn it into an `adder' function.  (add 5)
is a function that adds
five to its argument.  Now the `adder' function maps numbers to
adders.  An adder
maps numbers to numbers.

The space of adder functions is interesting in and of itself.  (Like
the gravitational
field is interesting even if you never drop anything.)  The operation
of currying gets
us out of the base space and into the higher order space.  Yeah, it is a lambda
expression, but not just *any* sort of lambda expression.  For example, the
LET form is implemeted as a lambda expression, but it usually isn't interesting
to think of it as a higher-order function that has some ontological
higher meaning.


Posted on the users mailing list.