Attribute-Curried
view release on metacpan or search on metacpan
function has enough arguments, it will perform its operation and
return a value.
The typical Scheme example is something like this:
(define add (lambda (a) (lambda (b) (+ a b))))
(define add2 (add 2))
(map add2 (list 1 2 3))
;; => (list 3 4 5)
Using C<Attribute::Curried>, the Perl equivalent looks like this:
sub add :Curry(2) { $_[0] + $_[1] }
*add2 = add(2);
map { add2($_) } 1..3;
# => (3, 4, 5)
=head1 AUTHOR
Sean O'Rourke, E<lt>seano@cpan.orgE<gt>
( run in 0.386 second using v1.01-cache-2.11-cpan-607d282f910 )