FP::Combinators2 - more function combinators
use FP::Combinators2 ":all"; use FP::Array qw(array); use FP::Equal ":all"; my $ra = right_associate_(\&array, 0); is_equal $ra->(qw(a b c d)), ['a', ['b', ['c', 'd']]]; is_equal $ra->(qw(a b)), ['a', 'b']; is_equal $ra->(qw(a)), 'a'; is_equal $ra->(), 0; my $la = left_associate_(\&array, 0); is_equal $la->(qw(a b c d)), [[['a', 'b'], 'c'], 'd']; is_equal $la->(qw(a b)), ['a', 'b']; is_equal $la->(qw(a)), 'a'; is_equal $la->(), 0;
This is an extension of FP::Combinators for functions that need more dependencies and can't be put into the former because of circular dependencies.
FP::Combinators
This is alpha software! Read the status section in the package README or on the website.
To install FunctionalPerl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FunctionalPerl
CPAN shell
perl -MCPAN -e shell install FunctionalPerl
For more information on module installation, please visit the detailed CPAN module installation guide.