autocurry

Turn the function what into a curried function.

template autocurry(alias Fun)
autocurry
(
P[0] arg
)
if (
isCallable!Fun
)

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