1 package Moose::Autobox::Code;
2 use Moose::Role 'with';
7 with 'Moose::Autobox::Ref';
11 return sub { $f->(@a, @_) }
16 return sub { $f->(@_, @a) }
20 my ($f, $f2, @rest) = @_;
22 return (sub { $f2->($f->(@_)) })->compose(@rest);
27 return sub { $f->(@_) || $f2->(@_) }
32 return sub { $f->(@_) && $f2->(@_) }
43 Moose::Autobox::Code - the Code role
50 my $adder = sub { $_[0] + $_[1] };
52 $add_2 = $adder->curry(2);
54 $add_2->(2); # returns 4
78 All complex software has bugs lurking in it, and this module is no
79 exception. If you find a bug please either email me, or add the bug
84 Stevan Little E<lt>stevan@iinteractive.comE<gt>
86 =head1 COPYRIGHT AND LICENSE
88 Copyright 2006 by Infinity Interactive, Inc.
90 L<http://www.iinteractive.com>
92 This library is free software; you can redistribute it and/or modify
93 it under the same terms as Perl itself.