MouseX...:Moose(3pm)

πŸ“¦
version 0.06 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

MouseX::Types::Moose β€” it's MouseX::Types::Mouse bestie, but with drop-in compatibility with Any::Moose on top. That's the whole vibe. ✨

Like, if you've got old code that still says Any::Moose everywhere, this module has your back and doesn't make you rewrite your whole life. Slay. πŸ’…


🌸 SYNOPSIS 🌸

okay so here's literally how you use it, no cap:

package Foo;
use Any::Moose;
use Any::Moose '::Types::Moose' => [qw( Int ArrayRef )];

has name => (
  is  => 'rw',
  isa => Str;
);

has ids => (
  is  => 'rw',
  isa => ArrayRef[Int],
);

1;

Look at that. You're pulling Any::Moose in, then asking it for '::Types::Moose' and handing it a list β€” Int and ArrayRef β€” and it just... gives you the types. 🫢 Then has does its thing, isa => Str for your name (yes bestie, exactly as written up there πŸ‘€), and ids gets ArrayRef[Int] because parameterized types are iconic and we love her. πŸŽ€

Then 1; at the end because Perl wants a true value and we respect Perl's needs. ⭐


πŸ¦‹ SEE ALSO πŸ¦‹

  • MouseX::Types::Mouse β€” the whole reason this module exists, go say hi πŸ’œ

k that's the page!! πŸ“ written up for perl v5.34.0, dated 2022-06-16, and filed under the MouseX...:Moose(3pm) manual β€” mwah, go forth and type your attributes, bestie πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from