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. π«Ά
π COPYRIGHT AND LICENCE π
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
- alpine 3.24: perl-type-tiny-doc 2.010001-r0 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms