Scroll to navigation

MooX::TypeTiny(3pm) User Contributed Perl Documentation MooX::TypeTiny(3pm)

NAME

MooX::TypeTiny - Optimized type checks for Moo + Type::Tiny

SYNOPSIS

  package Some::Moo::Class;
  use Moo;
  use MooX::TypeTiny;
  use Types::Standard qw(Int);
  has attr1 => (is => 'ro', isa => Int);

DESCRIPTION

This module optimizes Moo type checks when used with Type::Tiny to performbetter. It will automatically apply to isa checks and coercions that useType::Tiny. Non-Type::Tiny isa checks will work as normal.

This is done by inlining the type check in a more optimal manner that isspecific to Type::Tiny rather than the general mechanism Moo usually uses.

With this module, setters with type checks should be as fast as an equivalentcheck in Moose.

It is hoped that eventually this type inlining will be done automatically,making this module unnecessary.

AUTHOR

haarg - Graham Knop (cpan:HAARG) <haarg@haarg.org>

CONTRIBUTORS

None so far.

COPYRIGHT

Copyright (c) 2015 the MooX::TypeTiny "AUTHOR" and "CONTRIBUTORS"as listed above.

LICENSE

This library is free software and may be distributed under the same termsas perl itself. See <http://dev.perl.org/licenses/>.

2022-06-30 perl v5.34.0