Type::Tiny::XS(3pm)
β¨ Type::Tiny::XS β¨
okay so bestie, this is the manual page for Type::Tiny::XS, which is a little XS speed boost for some of Type::Tiny's built-in type constraints. she's fast, she's C-based, she's optional, and she's here to make your type checks go brrr π
πΈ SYNOPSIS πΈ
use Types::Standard qw(Int);
that's it. that's the whole vibe. π«Ά
π DESCRIPTION π
So here's the tea: Type::Tiny 0.045_03 and above can optionally use this module to get faster, C-based implementations of some type constraints. Like, actual compiled C doing your validation for you. iconic behavior honestly.
And the best part? This package has only core dependencies, and it does not depend on Type::Tiny at all. So if you're out here using some other data validation framework, you might wanna consider borrowing her too. she's for everybody fr fr. π
okay so now, the important part. only these three functions count as the supported API. memorize them, respect them, love them:
Type::Tiny::XS::get_coderef_for($type)β you hand her a supported type constraint name, like"Int", and she gives you back a coderef you can use to validate a parameter against that constraint. and if this module can't provide a suitable coderef for you? she returnsundef. no drama, no lie πType::Tiny::XS::get_subname_for($type)β literally the same asget_coderef_forexcept instead of the coderef she gives you the name of that sub, as a string. and again, if this module cannot provide a suitable sub name, it'sundeffor you bestie. πType::Tiny::XS::is_known($coderef)β returns true if the coderef was provided byType::Tiny::XS. tiny little vibe check, does exactly what it says. β¨
And beyond those three? the subs that get_coderef_for and get_subname_for return are also considered part of the supported API β but β οΈ only for the lifetime of the Perl process that returned them. so like, temporary bestie energy.
To clarify (because this one matters, no cap), if you call get_subname_for("ArrayRef[Int]") in a script, this will return the name of a sub. that sub β which you can use to validate arrayrefs of integers β is now considered part of the supported API of Type::Tiny::XS until the script finishes running. next time the script runs, there is no guarantee that the sub will continue to exist, or continue to do the same thing. she may be completely different. she may not be there at all. π¦
So yeah: don't be out here persisting assumptions about these subs across runs. that's not the deal. π
π BUGS π
found a bug? please report it, bestie, we wanna know:
<http://rt.cpan.org/Dist/Display.html?Queue=Type-Tiny-XS>
(i'm keeping that URL exactly as she is, don't @ me)
β SEE ALSO β
Type::TinyTypes::Standard
go look at them, they're the main characters of this whole story π
π AUTHOR π
Toby Inkster <tobyink@cpan.org> β and fun fact, he forked all this from Mouse::Util::TypeConstraints. so there's a whole ancestry here, we love a lineage moment.
Also, the ArrayLike, HashLike, CodeLike, and StringLike constraints are based on code by ikegami on StackOverflow. credit where credit is due π«Ά
<https://stackoverflow.com/a/64019481/1990570>
(yes im keeping that link verbatim too, it's part of the record)
π COPYRIGHT AND LICENCE π
This software is copyright (c) 2014, 2018-2020 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. slay, free software, we love her.
π¨ DISCLAIMER OF WARRANTIES π¨
okay listen, this is the serious one so imma say it loud:
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. none. zero. don't come for her if she doesn't do the thing. you've been warned, bestie π
π« and that's the whole page!
perl v5.42.3 Β· 2026-08-19 β that's the version and the date this page belongs to, mwah, go forth and validate your types fast πβ¨π
π¦ where this page comes from
- ubuntu stonking: libtype-tiny-xs-perl 0.025-2build2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms