autocurry

Turn the function what into a curried function.

  1. auto autocurry(P[0] arg)
    template autocurry(alias Fun)
    static if(P.length)
    autocurry
    (
    P[0] arg
    )
    if (
    isCallable!Fun
    )
  2. alias autocurry = Fun

Members

Aliases

P
alias P = Parameters!Fun
Undocumented in source.
autocurry
alias autocurry = Fun
Undocumented in source.

Functions

autocurry
auto autocurry(P[0] arg)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

static float foo(int a, string b, float c) @safe pure nothrow @nogc
{
    return a + b.length + c;
}
alias foo_ = autocurry!foo; // overloads the auto-curried foo with the original foo
assert(foo_(52)("alpha")(1) == 58);

See Also

Meta