cleaned up and clarified docs, made the load teset work again, fixed Makefile.PL...
[gitmo/MooseX-Types-Structured.git] / lib / MooseX / Meta / TypeConstraint / Role / Structured.pm
index d3beb38..6f2afff 100644 (file)
@@ -12,6 +12,23 @@ MooseX::Meta::TypeConstraint::Role::Structured - Structured Type Constraints
 
 This Role defines the interface and basic behavior of Structured Type Constraints.
 
+Structured type constraints let you assign an internal pattern of type
+constraints to a 'container' constraint.  The goal is to make it easier to
+declare constraints like "ArrayRef[Int, Int, Str]" where the constraint is an
+ArrayRef of three elements and the internal constraint on the three is Int, Int
+and Str.
+
+To accomplish this, we add an attribute to the base L<Moose::Meta::TypeConstraint>
+to hold a L</signature>, which is a reference to a pattern of type constraints.
+We then override L</constraint> to check our incoming value to the attribute
+against this signature pattern.  Additionally we allow L</optional_signature> to
+hold any optional type constraints.  The overall goal is to support something
+like:
+
+    has 'attr' => (isa=>'Tuple[Int, Str, Optional[Int, Int]]');
+
+These classes define how the underlying support for this works.
+
 =head1 TYPES
 
 The following types are defined in this class.