Future of string lambda functions/string predicate functions

Meta jared771 at gmail.com
Tue Aug 6 12:38:06 PDT 2013


On Tuesday, 6 August 2013 at 09:05:57 UTC, Jakob Ovrum wrote:
>  * Add deprecation notes to std.functional's unaryFun and 
> binaryFun so users are dissuaded from using them in new code. 
> In time, we would remove their documentation.

Looks good except for the above point. UnaryFun and binaryFun 
still have valid use cases, and I'd argue that it's even worth 
making an nAryFun!(pred, arity).

import std.functional;
import std.stdio;

alias less = (int a, int b) => a < b; //Error
alias less = binaryFun!((a, b) => a < b); //Ok

void main()
{
     writeln(less(1, 2)); //True
}


More information about the Digitalmars-d mailing list