NAME

FP::Collection

SYNOPSIS

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);

DESCRIPTION

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.

SEE ALSO

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.

NOTE

This is alpha software! Read the status section in the package README or on the website.