rollback some stuff to reset my brain a bit
[gitmo/MooseX-Types-Structured.git] / lib / MooseX / Meta / TypeConstraint / Role / Structured.pm
index 00e7722..6f2afff 100644 (file)
@@ -8,17 +8,26 @@ requires qw(_normalize_args signature_equals);
 
 MooseX::Meta::TypeConstraint::Role::Structured - Structured Type Constraints
 
-=head1 VERSION
+=head1 DESCRIPTION
 
-0.01
+This Role defines the interface and basic behavior of Structured Type Constraints.
 
-=cut
+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.
 
-our $VERSION = '0.01';
+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:
 
-=head1 DESCRIPTION
+    has 'attr' => (isa=>'Tuple[Int, Str, Optional[Int, Int]]');
 
-STUB - TBD
+These classes define how the underlying support for this works.
 
 =head1 TYPES
 
@@ -66,15 +75,6 @@ has 'optional_signature' => (
 
 This class defines the following methods.
 
-=head2 _normalize_args
-
-Get arguments into a known state or die trying.  Ideally we try to make this
-into a HashRef so we can match it up with the L</signature> HashRef.
-    
-=head2 constraint
-
-The constraint is basically validating the L</signature> against the incoming
-
 =head2 equals
 
 modifier to make sure equals descends into the L</signature>
@@ -97,10 +97,6 @@ around 'equals' => sub {
     return 1;
 };
 
-=head2 signature_equals
-
-Check that the signature equals another signature.
-
 =head1 AUTHOR
 
 John James Napiorkowski <jjnapiork@cpan.org>