FP::Collection
use FP::Equal qw(equal is_equal); use FP::Collection; my $c= Collection 10, 12, 9, 13; ok $c->contains(12); ok not $c->contains(11); # my $c2 = $c->add(11); TODO # ok $c2->contains(11); # ok not $c->contains(11); # always sorted? Oh, and by string? is_equal [$c->values], [10, 12, 13, 9]; is_equal Collection(10, 13), Collection(13, 10); ok not equal Collection(10, 13), Collection(13, 10, 11); ok not equal Collection(10, 13), Collection(13, 10, 11);
Unlike FP::HashSet these are objects, but there's currently not much more to it and those two should either be merged into 1 module (that can handle both blessed and unblessed ones?), or FP::Collection should be the pure variant. Thus this is very much unfinished.
Implements: FP::Abstract::Show, FP::Abstract::Equal. (TODO: FP::Abstract::Sequence?)
Members have to implement (or be covered by FP::Id::id): FP::Abstract::Id.
Other: FP::HashSet.
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.