Types::...::Tuple(3)

✨ Types::Standard::Tuple πŸ’…

okay so bestie, the manual name is Types::...::Tuple(3) β€” it's a Perl manpage, yes we're doing Perl, and it's the exporter utility for the Tuple type constraint. she's giving ✨ utility ✨ she's giving ✨ type checking ✨ no cap.


🌸 SYNOPSIS 🌸

the normal way to validate a pair of integers, fr fr:

use Types::Standard -types;

# Normal way to validate a pair of integers.
#
Tuple->of( Int, Int )->assert_valid( [ 7, 49 ] );

use Types::Standard::Tuple IntPair => { of => [ Int, Int ] },

# Exported shortcut
#
assert_IntPair [ 7, 49 ];

that's the vibe. that's the whole vibe. πŸ’–


πŸŽ€ STATUS πŸŽ€

heads up bestie: this module is not covered by the Type-Tiny stability policy. so like. she's experimental. she's thriving in her experimental era. don't come for her when she shifts on you πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

this is mostly internal code, but she can also act as an exporter utility. dual threat. main character energy. πŸ‘‘

🌟 Exports 🌟

Types::Standard::Tuple can be used experimentally as an exporter.

use Types::Standard 'Int';
use Types::Standard::Tuple IntPair => { of => [ Int, Int ] };

this will export the following functions into your namespace, and like β€” all four, no crumbs:

  • "IntPair"
  • is_IntPair( $value )
  • assert_IntPair( $value )
  • to_IntPair( $value )

multiple types can be exported at once, because why have one when you can have several:

use Types::Standard -types;
use Types::Standard::HashRef (
  IntPair  => { of => [ Int, Int ] },
  StrInt   => { of => [ Str, Int ] },
);

assert_StrInt [ two => 2 ];   # should not die

^^ that one should not die. it ate. it slays. πŸ”₯

and it's possible to further constrain the tuple using where, if you're feeling extra:

use Types::Standard::Tuple MyThing => { of => [ ... ], where => sub { ... } };

πŸ› BUGS πŸ›

found a bug? please report any bugs to <https://github.com/tobyink/p5-type-tiny/issues>. be nice about it, it's giving constructive πŸ’–


πŸ” SEE ALSO πŸ”

  • Types::Standard.

🧚 AUTHOR 🧚

Toby Inkster <tobyink@cpan.org>. icon. legend. the moment. 🫢


this software is copyright (c) 2013-2025 by Toby Inkster.

this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. periodt. free as in ✨ free ✨.


πŸ’€ DISCLAIMER OF WARRANTIES πŸ’€

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

like, no promises bestie. you get what you get. πŸ™ˆ


🌈 and that's the page! brought to you by perl v5.42.2, dated 2026-04-07 β€” yes that's the actual version and date at the bottom of the original, i'm not making that up, the footer is literally the receipts πŸ’œ ty for coming to my ted talk, go validate some tuples πŸŽ€

πŸ“¦ where this page comes from