Discussion Thread: DIP 1041--Attributes for Higher-Order Functions--Community Review Round 1

jmh530 john.michael.hall at gmail.com
Wed Apr 14 23:49:49 UTC 2021


On Wednesday, 14 April 2021 at 22:23:38 UTC, Timon Gehr wrote:
> [snip]
> With proper attribute polymorphism, one can just state that in 
> code:
>
> ---
> int apply[qual a,qual b](int delegate(int delegate(int)a)b f, 
> int delegate(int)a g)b{
>     return f(g);
> }
> ---
>
> This solution is simple and more general, but most importantly, 
> it does not redefine the meaning of existing types in 
> non-compositional ways and the language does not paint itself 
> into a corner by adopting such a solution. It does not break 
> existing code nor prevent additional features to be added later.

Thanks for the explanation!

I'm not sure I really grok all the ways it could be used, but it 
makes sense.



More information about the Digitalmars-d mailing list