X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FMeta%2FTypeConstraint%2FStructured.pm;h=166794772a135c590616709040463bdfdc79631a;hb=8b810e835ea88682b4858363749fa201e9b45126;hp=a770be01048689d0c296167ad70872929c011fad;hpb=5d2d822d70e0cd799435e8f0f1e6783a856e7ebe;p=gitmo%2FMooseX-Types-Structured.git diff --git a/lib/MooseX/Meta/TypeConstraint/Structured.pm b/lib/MooseX/Meta/TypeConstraint/Structured.pm index a770be0..1667947 100644 --- a/lib/MooseX/Meta/TypeConstraint/Structured.pm +++ b/lib/MooseX/Meta/TypeConstraint/Structured.pm @@ -1,6 +1,6 @@ package ## Hide from PAUSE MooseX::Meta::TypeConstraint::Structured; -# ABSTRACT: MooseX::Meta::TypeConstraint::Structured - Structured type constraints. +# ABSTRACT: Structured type constraints. use Moose; use Devel::PartialDump; @@ -13,12 +13,12 @@ extends 'Moose::Meta::TypeConstraint'; A structure is a set of L that are 'aggregated' in such a way as that they are all applied to an incoming list of arguments. The -idea here is that a Type Constraint could be something like, "An Int followed by -an Int and then a Str" and that this could be done so with a declaration like: +idea here is that a Type Constraint could be something like, "An C followed by +an C and then a C" and that this could be done so with a declaration like: Tuple[Int,Int,Str]; ## Example syntax -So a structure is a list of Type constraints (the "Int,Int,Str" in the above +So a structure is a list of type constraints (the C in the above example) which are intended to function together. =attr type_constraints @@ -35,6 +35,8 @@ has 'type_constraints' => ( =attr constraint_generator +=for stopwords subref + A subref or closure that contains the way we validate incoming values against a set of type constraints. @@ -61,7 +63,7 @@ sub _build_coercion { =method validate -Messing with validate so that we can support niced error messages. +Messing with validate so that we can support nicer error messages. =cut @@ -112,6 +114,8 @@ sub generate_constraint_for { return $self->constraint_generator->($self, $type_constraints); } +=for stopwords parameterize + =method parameterize (@type_constraints) Given a ref of type constraints, create a structured type. @@ -134,6 +138,8 @@ sub parameterize { =method __infer_constraint_generator +=for stopwords servicable + This returns a CODEREF which generates a suitable constraint generator. Not user servicable, you'll never call this directly.