\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A =pod =encoding utf-8 =head1 NAME Type::Tiny::Manual - an overview of Type::Tiny =head1 SYNOPSIS L is a small class for writing type constraints, inspired by L's type constraint API. It has only one non-core dependency (and even that is simply a module that was previously distributed as part of Type::Tiny but has since been spun off), and can be used with L, L and L (or none of the above). Type::Tiny is bundled with L a framework for organizing type constraints into collections. Also bundled is L, a Moose-inspired library of useful type constraints. L is also provided, to allow very fast checking and coercion of function and method parameters. =head1 SEE ALSO =over =item * L - how to build a type library with Type::Tiny, Type::Library and Type::Utils =item * L - adding coercions to type constraints =item * L - how to use Type::Tiny and Type::Library with Moose =item * L - how to use Type::Tiny and Type::Library with Mouse =item * L - how to use Type::Tiny and Type::Library with Moo =item * L - how to use Type::Tiny and Type::Library with other OO frameworks =item * Type::Tiny and friends don't need to be used within an OO framework. See L for an example that does not. =item * L - coerce and validate arguments to functions and methods. =item * Other modules using Type::Tiny in interesting ways: L, L, L, L... =item * L - squeeze the most out of your CPU. =item * L - the stability policy. =back =head1 DEPENDENCIES Type::Tiny requires at least Perl 5.6.1, though certain Unicode-related features (e.g. non-ASCII type constraint names) may work better in newer versions of Perl. Type::Tiny requires L, a module that was previously bundled in this distribution, but has since been spun off as a separate distribution. Don't worry - it's quick and easy to install. At run-time, Type::Tiny also requires the following modules: L, L, L, L, L, L, L, L and L. All of these come bundled with Perl itself. Prior to Perl 5.8, L and L do not come bundled with Perl and will need installing separately from the CPAN. Certain features require additional modules. Tying a variable to a type constraint (e.g. C<< tie my $count, Int >>) requires L; stack traces on exceptions require L. The L plugin for L requires L (obviously). L may I increase the speed of some of Type::Tiny's compiled coderefs. L is not required, but if available provides a speed boost for some type checks. (Setting the environment variable C to false, or setting C to true will suppress the use of Type::Tiny::XS, even if it is available.) The test suite additionally requires L, L and L. Test::More comes bundled with Perl, but if you are using a version of Perl older than 5.14, you will need to upgrade to at least Test::More version 0.96. Test::Requires and Test::Fatal (plus Try::Tiny which Test::Fatal depends on) are bundled with Type::Tiny in the C directory, so you do not need to install them separately. If using Type::Tiny in conjunction with L, then at least Moo 1.000000 is recommended. If using Type::Tiny with L, then at least Moose 2.0000 is recommended. If using Type::Tiny with L, then at least Mouse 1.00 is recommended. Type::Tiny is mostly untested against older versions of these packages. =head1 TYPE::TINY VERSUS X =head2 Specio Type::Tiny is similar in aim to L. The major differences are =over =item * Type::Tiny is "tiny" (Specio will eventually have fewer dependencies than it currently does, but is unlikely to ever have as few as Type::Tiny); =item * Specio has a somewhat nicer API (better method names; less duplication), and its API is likely to improve further. Type::Tiny's aims at complete compatibility with current versions of Moose and Mouse, so there is a limit to how much I can deviate from the existing APIs of (Moose|Mouse)::Meta::TypeConstraint. =back =head2 MooseX::Types Type::Tiny libraries expose a similar interface to L libraries. In most cases you should be able to rewrite a L library to use Type::Tiny pretty easily. =head2 MooX::Types::MooseLike Type::Tiny is faster and supports coercions. =head2 Scalar::Does L is somewhat of a precursor to Type::Tiny, but has now been rewritten to use Type::Tiny internally. It gives you a C<< does($value, $type) >> function that is roughly equivalent to C<< $type->check($value) >> except that C<< $type >> may be one of a list of pre-defined strings (instead of a Type::Tiny type constraint); or may be a package name in which case it will be assumed to be a role and checked with C<< $value->DOES($type) >>. =head1 BUGS Please report any bugs to L. =head1 SUPPORT B<< IRC: >> support is available through in the I<< #moops >> channel on L. =head1 AUTHOR Toby Inkster Etobyink@cpan.orgE. =head1 COPYRIGHT AND LICENCE This software is copyright (c) 2013-2014, 2017-2019 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. =head1 DISCLAIMER OF WARRANTIES 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. =cut