MouseX...:Mouse(3pm)

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

πŸ’– MouseX::Types::Mouse πŸ’–

okay so bestie, this is the manual page for MouseX::Types::Mouse(3pm), and it's literally the type catalog that ships with Mouse 🐭✨ β€” like, the little box of types you get handed for free. That's the whole vibe. It's giving "you don't have to build your own types from scratch, queen." πŸ‘‘


✨ SYNOPSIS ✨

here's the whole flex, verbatim, no edits, I would never πŸ™ˆ:

package Foo;
use Mouse;
use MouseX::Types::Mouse qw( Int ArrayRef );

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

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

1;

so the way that works, bestie: you use Mouse, you pull in Int and ArrayRef from MouseX::Types::Mouse with that qw( ... ) list, and then you just... hand them to isa in your has declarations. that's it. that's the move. πŸ’…

ArrayRef[Int] is the iconic one β€” parameterized type, main character energy, telling everyone your array is full of ints. πŸ‘‘


🌸 SEE ALSO 🌸

  • MouseX::Types β€” the bigger picture, go look πŸ¦‹
  • Mouse::Util::TypeConstraints β€” where the type machinery lives πŸ”§

and that's the whole page!! short, sweet, slay. πŸŽ€

this little icon was served up with perl v5.34.0, dated 2022-06-16 β€” so go forth and type-check your attributes, bestie. 🫢 no cap. πŸ’œ

πŸ“¦ where this page comes from