logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Author

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

Contributors

       None so far.

Description

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

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

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

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

License

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

perl v5.34.0                                       2022-06-30                                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);

See Also