MooX::TypeTiny(3)

πŸ’– NAME πŸ’–

MooX::TypeTiny β€” optimized type checks for Moo + Type::Tiny. Basically it's the glow-up your isa checks have been begging for πŸ’… (and yeah, this is from the User Contributed Perl Documentation, in case you were wondering 🫢)

✨ SYNOPSIS ✨

Okay so picture this β€” you're writing a class, you've got types, and you want it all to slay:

package Some::Moo::Class;
use Moo;
use MooX::TypeTiny;
use Types::Standard qw(Int);

has attr1 => (is => 'ro', isa => Int);

That's it. That's the whole vibe. You just use it and it does the thing 🧚

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea, bestie: this module optimizes Moo type checks when you're using them with Type::Tiny, so they perform way better. No cap. πŸ”₯

It'll automatically apply itself to isa checks and coercions that use Type::Tiny. And any isa checks that are not from Type::Tiny? Those still work exactly like normal. Everyone's invited to the party πŸ’–

How does it do it? It inlines the type check in a more optimal way that's specific to Type::Tiny, rather than using the general mechanism Moo usually reaches for. Tailored. Bespoke. Iconic. πŸ‘‘

With this module, setters that have type checks should be as fast as an equivalent check in Moose. Literally the speed you deserve ✨

And the hope? That eventually this type inlining will just happen automatically, which would make this module unnecessary. Until then, we stan MooX::TypeTiny πŸ™ˆ


🌸 AUTHOR 🌸

haarg β€” Graham Knop (cpan:HAARG) <haarg@haarg.org> 🫢

πŸŽ€ CONTRIBUTORS πŸŽ€

None so far. The way this list is empty 😭 (there's room for you though, just saying πŸ‘€)

Copyright (c) 2015 the MooX::TypeTiny "AUTHOR" and "CONTRIBUTORS" as listed above. Keeping it legal, keeping it cute πŸ’…

🌈 LICENSE 🌈

This library is free software and may be distributed under the same terms as perl itself. Go check it out: <http://dev.perl.org/licenses/> πŸ¦‹


✨ And that's the whole page, bestie! Brought to you by perl v5.40.0, fresh from 2024-08-06 β€” go forth and type-check your little heart out πŸ’–πŸŽ€πŸŒŸ
πŸ“¦ where this page comes from