reduce -> fold?

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sat Jan 30 09:40:38 PST 2016


On 1/30/16 12:25 PM, Xinok wrote:
> On Saturday, 30 January 2016 at 12:11:37 UTC, Ola Fosheim Grøstad wrote:
>> Currying is pointless, I believe Swift is removing it. ...
>
> It might be fairly useless in D but it's definitely not useless in
> general. It' a different design pattern and functional languages make
> great use of it. OTOH, D substitutes it with other design patterns like
> UFCS and template arguments, e.g. arr.sort!"a > b".
>
> Phobos even has a function which mimics currying via
> std.functional.partial:
>
> https://dlang.org/phobos/std_functional.html#partial

I forgot the distinction between currying and partial application. Can 
we also define currying in current D? -- Andrei


More information about the Digitalmars-d mailing list