MooseX...Mooish(3pm)
π MooseX::Meta::TypeConstraint::Mooish π
okay so bestie, welcome to MooseX::Meta::TypeConstraint::Mooish, aka the little translator that takes your Moo-style constraints and makes them speak fluent Moose. it's a Perl module, it lives in User Contributed Perl Documentation, and it's about to change your whole has game. slay. π
β¨ VERSION β¨
this doc is describing version 0.001 of MooseX::Meta::TypeConstraint::Mooish β it dropped March 12, 2015, as part of the MooseX-Meta-TypeConstraint-Mooish fam. vintage but iconic, no cap. π
πΈ SYNOPSIS πΈ
easiest route? go through AttributeShortcuts. the way that it just works:
# easiest is via AttributeShortcuts
use MooseX::AttributeShortcuts 0.028;
has foo => (
is => 'rw',
isa => sub { die unless $_[0] == 5 },
);
or, the hard way (respect, but it's giving extra steps):
# or, the hard way
use MooseX::Meta::TypeConstraint::Mooish;
has foo => (
is => 'rw',
isa => MooseX::Meta::TypeConstraint::Mooish->new(
constraint => sub { die unless $_[0] == 5 },
),
);
π¦ DESCRIPTION π¦
so here's the tea, bestie. π΅
Moose type constraints are expected to return true if the value passes the constraint, and false otherwise. Moo "constraints", on the other hand? they just straight-up die if validation fails. different philosophies, same energy, lowkey incompatible.
this metaclass allows for Moo-style constraints; it will wrap them and translate their Moo into a dialect Moose understands. it's literally a translator. π
note that this is largely to enable functionality in MooseX::AttributeShortcuts; the easiest way use this metaclass is by using that package.
also β and this is the fun part β as it's not inconceivable that this functionality may be desired in other constraint metaclasses, the bulk of this metaclass' functionality is implemented as a trait. modular queen behavior. π
π₯ SEE ALSO π₯
please see those modules/websites for more information related to this module, bestie:
MooseX::AttributeShortcutsMooseX::TraitFor::Meta::TypeConstraint::Mooish
π SOURCE π
the development version is on github at <http://https://github.com/RsrchBoy/moosex-meta-typeconstraint-mooish> and may be cloned from <git://https://github.com/RsrchBoy/moosex-meta-typeconstraint-mooish.git>
go forth and clone, babe. π«Ά
π BUGS π
please report any bugs or feature requests on the bugtracker website <https://github.com/RsrchBoy/moosex-meta-typeconstraint-mooish/issues>
when submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. fr fr, a reproducer is the whole vibe β no test file, no diagnosis. π
π AUTHOR π
Chris Weyl <cweyl@alumni.drew.edu>
π I'm a material boy in a material world π
please note I do not expect to be gittip'ed or flattr'ed for this work, rather it is simply a very pleasant surprise. I largely create and release works like this because I need them or I find it enjoyable; however, don't let that stop you if you feel like it ;)
Flattr this
<https://flattr.com/submit/auto?user_id=RsrchBoy&url=https%3A%2F%2Fgithub.com%2FRsrchBoy%2Fmoosex-
meta-typeconstraint-mooish&title=RsrchBoy's%20CPAN%20MooseX-Meta-
TypeConstraint-Mooish&tags=%22RsrchBoy's%20MooseX-Meta-TypeConstraint-
Mooish%20in%20the%20CPAN%22>, gittip me
<https://www.gittip.com/RsrchBoy/>, or indulge my Amazon Wishlist
<http://bit.ly/rsrchboys-wishlist>... If you so desire.
π COPYRIGHT AND LICENSE π
this software is Copyright (c) 2015 by Chris Weyl.
this is free software, licensed under:
The GNU Lesser General Public License, Version 2.1, February 1999
and that's the whole page, bestie β sign-off time β¨ this was MooseX...Mooish(3pm) from perl v5.34.0, dated 2022-06-15, and you absolutely ate this read. go translate some constraints. periodt. ππ¦πΈ
π¦ where this page comes from
- debian bookworm: libmoosex-meta-typeconstraint-mooish-perl 0.001-2 Β· LGPL-2.1-only
- debian trixie: libmoosex-meta-typeconstraint-mooish-perl 0.001-2 Β· LGPL-2.1-only
- ubuntu noble: libmoosex-meta-typeconstraint-mooish-perl 0.001-2 Β· LGPL-2.1-only
- ubuntu resolute: libmoosex-meta-typeconstraint-mooish-perl 0.001-2 Β· LGPL-2.1-only
- ubuntu stonking: libmoosex-meta-typeconstraint-mooish-perl 0.001-2 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms