Types::Set - Set::Equivalence-related type constraints
package Band { use Moose; use Types::Standard qw( InstanceOf ); use Types::Set qw( Set ); has members => ( is => 'ro', isa => Set[ InstanceOf['Person'] ], coerce => 1, default => sub { +[] }, handles => { add_member => 'insert', has_member => 'contains', member_count => 'size', } ); }
Types::Set is a type constraint library built using Type::Tiny; compatible with Moose, Mouse, Moo and more.
AnySet
This type constraint is satisfied by any blessed object that provides insert, delete, members and contains methods.
insert
delete
members
contains
Set
A blessed Set::Equivalence object.
This may be parameterized with another type constraint; for example, Set[Num] is a set of numbers. In this case, not only must all the set members be numbers, but also the set itself must have a type constraint of Num (or a subtype of Num, such as Int) attached, which will prevent non-numeric values from being inserted into the set later.
Set[Num]
Num
Int
This type can coerce from ArrayRef and AnySet.
ArrayRef
MutableSet
Like Set, but must be a mutable set. Similar parameterization.
This type can coerce from ImmutableSet, ArrayRef and AnySet.
ImmutableSet
Like Set, but must not be a mutable set. Similar parameterization.
This type can coerce from MutableSet, ArrayRef and AnySet.
Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=Set-Equivalence.
Set::Equivalence.
Toby Inkster <tobyink@cpan.org>.
This software is copyright (c) 2013 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
To install Set::Equivalence, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Set::Equivalence
CPAN shell
perl -MCPAN -e shell install Set::Equivalence
For more information on module installation, please visit the detailed CPAN module installation guide.