reduce -> fold?
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Tue Feb 2 12:06:39 PST 2016
On 1/30/16 1:08 PM, David Nadlinger wrote:
> On Saturday, 30 January 2016 at 17:40:38 UTC, Andrei Alexandrescu wrote:
>> I forgot the distinction between currying and partial application. Can
>> we also define currying in current D? -- Andrei
>
> Currying is turning (A, B, C) -> D into A -> (B -> (C -> D)), i.e. a
> function with multiple arguments into a sequence of functions that each
> take a single argument to apply each.
>
> I think I've implemented something like that for fun once, but never
> really found much use for it. In the few places where I could have used
> it (mostly binary functions), just using a lambda and partial
> application seemed to be much more idiomatic. I guess D lacks any idioms
> that would make its use come naturally.
>
> - David
Thanks. I guess it'd be nice to have it on code.dlang.org somewhere so
people can play with it. -- Andrei
More information about the Digitalmars-d
mailing list