Following this post on perlgeek, it gives an example of currying:
my &add_two := * + 2;
say add_two(5); # 7
Makes sense. But if I swap the +
infix operator for the min
infix operator:
my &min_two := * min 2;
say min_two(5); # Type check failed in binding; expected 'Callable' but got 'Int'
Even trying to call +
via the infix
syntax fails:
>> my &curry := &infix:<+>(2, *);
Method 'Int' not found for invocant of class 'Whatever'
Do I need to qualify the Whatever as a numeric value, and if so how? Or am I missing the point entirely?
[Edited with responses from newer rakudo; Version string for above: perl6 version 2014.08 built on MoarVM version 2014.08
]