The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Type::Tiny::Manual - an overview of Type::Tiny

SYNOPSIS

Type::Tiny is a small framework for writing type constraints and organising them into type libraries. Although inspired by Moose's type constraint API, it has no non-core dependencies, and can be used with Moose, Mouse and Moo.

It provides a small Moose-inspired library of built-in type constraints.

TYPE::TINY VERSUS X

Specio

Type::Tiny is similar in aim to Specio. The major differences are that Type::Tiny is "tiny"; and Type::Tiny dispenses with the idea of a type registry and stringy access to type constraints.

MooseX::Types

Type::Tiny libraries expose a similar interface to MooseX::Types libraries. In most cases you should be able to rewrite a MooseX::Types library to use Type::Tiny easily. It might be wise to add a shim MooseX:: module:

   package Types::Foo {
      ...;
   }
   
   package MooseX::Types::Foo {
      sub import {
         require Types::Foo;
         splice(@_, 0, 1) = ("Types::Foo", "-moose");
         goto \&Types::Foo::import;
      }
   }

MooX::Types::MooseLike

Type::Tiny is faster and supports coercions.

SEE ALSO

  • Libraries - how to build a type library with Type::Tiny, Type::Library and Type::Utils

  • Using with Moose - how to use Type::Tiny and Type::Library with Moose

  • Using with Mouse - how to use Type::Tiny and Type::Library with Mouse

  • Using with Moo - how to use Type::Tiny and Type::Library with Moo

AUTHOR

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE

This software is copyright (c) 2013 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.

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.