[erlang-questions] will Erlang ever have currying?

Julian Fondren <>
Mon Sep 11 07:36:22 CEST 2006


On 9/8/06, Vlad Dumitrescu <> wrote:
> On 9/7/06, Vlad Dumitrescu <> wrote:
> >    some_fun(X, _, 3, _)
> >
> > would be syntactic sugar for
> >
> >    fun(XX, YY) -> some_fun(X, XX, 3, YY) end
>
> If anyone really wants to use this today, please go to
> http://forum.trapexit.org/viewtopic.php?p=21183, where I submitted a
> parse_transform that will let you use the above right away.

Neat!  I'll definitely try that.  I'd always taken it for granted that
Erlang can't
possibly have 'natural' currying in the sense of Haskell, due to the
pairwise-incompatibles:

automatic currying | n-ary functions | functions-named-by-arity

, but this is a really comfortable syntax for explict currying in Erlang.



More information about the erlang-questions mailing list