09 May 2017 23:11:58 UTC
- Distribution: MooseX-Types-Structured
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Issues (5)
- Testers (3745 / 5 / 0)
- KwaliteeBus factor: 3
- 87.63% Coverage
- License: perl_5
- Perl: v5.8.0
- Activity24 month
- Download (59.91KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:2 non-PAUSE usersETHER Karen Etheridge 🐾 🌋🦑🇹🇼🇭🇰
- SEE ALSO
- COPYRIGHT AND LICENSE
MooseX::Meta::TypeConstraint::Structured - Structured type constraints
A structure is a set of Moose::Meta::TypeConstraint 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
Intfollowed by an
Intand then a
Str" 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,Strin the above example) which are intended to function together.
A list of Moose::Meta::TypeConstraint objects.
Messing with validate so that we can support nicer error messages.
Given some type constraints, use them to generate validation rules for an ref of values (to be passed at check time)
Given a ref of type constraints, create a structured type.
hook into compile_type_constraint so we can set the correct validation rules.
modifier to make sure we get the constraint_generator
Override the base class behavior.
Checks to see if the internal type constraints are equal.
Give you a better peek into what's causing the error. For now we stringify the incoming deep value with Devel::PartialDump and pass that on to either your custom error message or the default one. In the future we'll try to provide a more complete stack trace of the actual offending elements
A subref or closure that contains the way we validate incoming values against a set of type constraints.
This returns a CODEREF which generates a suitable constraint generator. Not user servicable, you'll never call this directly.
The following modules or resources may be of interest.
There is also a mailing list available for users of this distribution, at http://lists.perl.org/list/moose.html.
There is also an irc channel available for users of this distribution, at
John Napiorkowski <email@example.com>
Florian Ragwitz <firstname.lastname@example.org>
יובל קוג'מן (Yuval Kogman) <email@example.com>
Tomas (t0m) Doran <firstname.lastname@example.org>
Robert Sedlacek <email@example.com>
This software is copyright (c) 2008 by John Napiorkowski.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install MooseX::Types::Structured, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install MooseX::Types::Structured
For more information on module installation, please visit the detailed CPAN module installation guide.