Curried functions

Michael McGlothlin mike.mcglothlin at gmail.com
Thu Oct 15 19:45:50 UTC 2015


I dislike that syntax because it makes the order of operations mysterious.
I like the idea of currying but it should always be clear what is going on.
A couple parentheses would make things a lot more obvious.

On Thu, Oct 15, 2015 at 8:02 AM, Mark S. Miller <erights at google.com> wrote:

> const add = a => b => a + b;
>
>
> On Thu, Oct 15, 2015 at 8:08 AM, Niloy Mondal <niloy.mondal84 at gmail.com>
> wrote:
>
>> It would be really cool to have syntax to curry functions built into the
>> languages. Something like...
>>
>> ```js
>> curry function add(a, b) {
>>     return a + b;
>> }
>>
>> add(2)(3); // 5
>> ```
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>>
>
>
> --
>     Cheers,
>     --MarkM
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20151015/92f8d3b3/attachment-0001.html>


More information about the es-discuss mailing list