[erlang-questions] Automatic currying

e@REDACTED e@REDACTED
Sat May 2 22:42:17 CEST 2015


> I suggest *not* doing any of this.
> Haskell tends to involve stuff like (`f`y) for
> providing the second argument, which looks distinctly
> odd when f has more than 2, and don't let's mention
> `flip' and its relatives.
>
> Why do I suggest not doing this?
> First, as already mentioned, the fact that Erlang
> functions are strict and effectful means that the
> distinction between F and F() is vital.
> Second, this isn't really how Erlang is _meant_ to
> be used, so unlike Haskell, the compiler is not
> going to put much effort into making this less slow.
> Most important, other people aren't going to expect
> to read Erlang code written this way, so it's not
> going to be as maintainable as possibly longer code
> that's more direct.

i want to add,
according to my experience,
currying tends to make code really (i mean _really_) unreadable.

i can not formally explain this effect,
on the contrary,
i love currying, and i would expect it to work nice,
but in real life:
it is very hard to _DETECT_ a partial application
during code reading.

so i consider "massive", wordy, explicit erlang's style
of partial application a huge advantage.

also i vote +1 to the Richard's observation regarding argument order
in the light of currying.





More information about the erlang-questions mailing list