Lambda returning a lambda?

Seb seb at wilzba.ch
Fri Feb 2 01:31:15 UTC 2018


On Thursday, 1 February 2018 at 15:41:00 UTC, aliak wrote:
> On Thursday, 1 February 2018 at 14:28:34 UTC, Simen Kjærås 
> wrote:
>> --
>>   Simen
>
> Ah, thank you both. For solution and explanation.
>
> Me wonders... are there any thoughts around having functions 
> return aliases as well? I have no idea if it's even possible 
> but if it is, then does the initial syntax become possible? Or 
> some kind of lazy type deduction that just tries to determine 
> type when actually needed, and everything is an alias until 
> that point?
>
> Would a library curry solution on an alias lambda be possible?
>
> alias f = curry!((a, b) => a * b) ?

Are you aware of partial?

https://dlang.org/phobos/std_functional.html#partial


More information about the Digitalmars-d-learn mailing list