[erlang-questions] will Erlang ever have currying?

Vlad Dumitrescu <>
Wed Sep 6 09:34:24 CEST 2006


Hi,

On 9/6/06, t ty <> wrote:
> I usually use currying for a cheap form of partial evaluation. One
> simple operation I have is to test that two list matches. One list is
> actually fix for a particular run, while I may have several hundred
> thousands of the second parameter in the run.

I would venture to guess that in this case simple currying won't help
you very much.

Taking as example a vector dot-product, where one of the vectors is
static and sparse (many zeroes), simple currying will still let the
code do many unnecessary multiplications by zero and additions of
zero. What you really want is to be able to completely remove the code
for that, and generate a fun that just multiplies and add the relevant
values.

best regards,
Vlad



More information about the erlang-questions mailing list