Types::...rd::Map(3)
π Types::...rd::Map(3) β like, the actual manual page, bestie
okay so real talk, this is Types::...rd::Map(3) from the User Contributed Perl Documentation and it's here to explain Types::Standard::Map to you. grab a boba, we're doing this πΈ
β¨ NAME β¨
Types::Standard::Map β an exporter utility for the Map type constraint. that's the whole vibe π
π SYNOPSIS π
like, the normal way to validate a map:
use Types::Standard -types;
# Normal way to validate map.
#
Map->of( Int, Str )->assert_valid( { 1 => "one" } );
use Types::Standard::Map IntsToStrs => { keys => Int, values => Str },
# Exported shortcut
#
assert_IntsToStrs { 1 => "one" };
(no, we did not "fix" that trailing comma β it's character for character what the page says, iykyk π)
β‘ STATUS β‘
not covered by the Type-Tiny stability policy, so like... it's giving experimental. act accordingly π«Ά
π DESCRIPTION π
ngl this is mostly internal code, but it also lowkey moonlights as an exporter utility. main character energy fr β¨
π§ Exports
Types::Standard::Map can be used experimentally as an exporter. periodt.
use Types::Standard 'Int';
use Types::Standard::Map IntsToStrs => { keys => Int, values => Str },
this will export the following functions into your namespace, slay:
"IntsToStrs"is_IntsToStrs( $value )assert_IntsToStrs( $value )to_IntsToStrs( $value )
and bestie, you can export multiple types at once β obsessed:
use Types::Standard -types;
use Types::Standard::Map (
IntsToStrs => { keys => Int, values => Str },
StrsToInts => { keys => Str, values => Int },
);
assert_StrsToInts { two => 2 }; # should not die
it's also possible to further constrain the hashref using "where" π
use Types::Standard::Dict MyThing => {
keys => Str->where( sub { ... } ),
values => Int->where( sub { ... } ),
where => sub { ... },
};
π BUGS π
found a bug? please report any bugs to <https://github.com/tobyink/p5-type-tiny/issues> π and be nice about it π
π SEE ALSO π
Types::Standardβ the icon itself β
π«Ά AUTHOR π«Ά
Toby Inkster <tobyink@cpan.org> π
π 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. free as in, go off π
π 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, that's the deal π read it, it's literally all caps for a reason.
and that's the whole page!! brought to you by perl v5.42.2 dated 2026-04-07, signing off β Types::...rd::Map(3) out ππ¦β¨
π¦ 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