Currying

All callable objects have an "assuming" method that can do partial application of either positional or named arguments. Here we curry the built-in subtraction operator.

my &negative = &infix:<->.assuming(0);
say negative 1;

Output:

-1

Last updated