Type::P...ignature(3)
π Type::Params::Signature(3) β bestie edition
ok so this is a page from the User Contributed Perl Documentation, and the module is Type::Params::Signature. sit down, grab a strawberry drink π, and let's get into it.
β¨ NAME β¨
Type::Params::Signature β the internal representation of a function signature. like, it's the vibe of your function's arguments, encoded as an object. main character energy fr.
π¦ STATUS π¦
Real talk: this module is not covered by the Type-Tiny stability policy. so like... it could change on you. no cap. π
π¦ DESCRIPTION π¦
Okay so mostly this is internal code β like, backstage crew, not the performer β but plot twist, you can use it to get basic introspection for signatures. it's giving "peek behind the curtain." π
π Constructors
new(%attributes)β the normal one, takes a hash of attributes.new_from_compile($style, %attributes)β takes a$styleplus the attributes.new_from_v2api(\%attributes)β takes a hashref of attributes. very old-school, very demure.
π Attributes
heads up bestie: all attributes are read-only. you look, you don't touch. π
packageβ ClassName. the package we're providing a signature for. it gets used to look up any stringy type names. iykyk.subnameβ Str. the sub we're providing a signature for.descriptionβ Str. a lil description, as a treat.methodβ ArrayRef[InstanceOf['Type::Params::Parameter']].headβ ArrayRef[InstanceOf['Type::Params::Parameter']].tailβ ArrayRef[InstanceOf['Type::Params::Parameter']].parametersβ ArrayRef[InstanceOf['Type::Params::Parameter']].slurpyβ InstanceOf['Type::Params::Parameter'].on_dieβ CodeRef.strictnessβ Bool|ScalarRef.nextβ CodeRef.goto_nextβ CodeRef. literally just an alias fornext. that's it. slay.can_shortcutβ Bool. tells you whether the signature has no potential to alter@_, which means it can be returned without being copied if the type checks pass. generally speaking, do not pass this to the constructor β just letType::Params::Signaturefigure it out. it's got this. π«Άcoderefβ InstanceOf['Eval::TypeTiny::CodeAccumulator']. you probably don't want to provide this to the constructor either. the whole point of this module is to build it for you! that's the job. π
πΈ Attributes related to named parameters
is_namedβ Bool.allow_dashβ Bool.blessβ Bool|ClassName.classβ ClassName.constructorβ Str.class_attributesβ HashRef. this is a HashRef suitable for passing to theimportmethod ofClass::XSAccessor. a default gets generated based onparameters.named_to_listβ ArrayRef. this one can be coerced from a bool based onparameters.list_to_namedβ Bool.oo_traceβ Bool. defaults to true. indicates whether blessed$arghashrefs created by the signature will include a'~~caller'key.
π§ Bare attributes
these attributes may be passed to the constructors and may do something, but no methods are provided to access the values later. so like... they're there. ghosting you, respectfully. π
positionalorposβ ArrayRef.namedβ ArrayRef.multipleormultiβ ArrayRef.returnsβ Bool. shortcut for settingreturns_scalarandreturns_listsimultaneously. two for one, we love efficiency.want_sourceβ Bool.want_detailsβ Bool.want_objectβ Bool.rationalize_slurpiesβ Bool. yes that's the real name. no i will not be commenting further.
π₯ Methods
β Predicates
predicate methods return true/false to indicate the presence or absence of attributes. very "are they or aren't they" energy.
has_descriptionhas_headhas_tailhas_parametershas_slurpyhas_on_diehas_strictnesshas_returns_scalarhas_returns_list
π Class making methods
these get called automatically during object construction and you should not typically call them yourself. they're public methods in case you wanna subclass Type::Params::Signature β which, honestly, go off. π
make_class_ppβ builds the class specified inblessby evaluating Perl code.make_class_xsβ builds the class specified inblessusingClass::XSAccessor.make_classβ calls eithermake_class_ppormake_class_xs. it picks. it's β¨decisiveβ¨.make_class_pp_codeβ generates the code formake_class_pp.
π Other methods
BUILDβ called by the constructors. you should not call this. like seriously bestie, hands off π ββοΈ.return_wantedβ normally returns the signature coderef, unlesswant_source,want_details, orwant_objectwere provided to the constructor. in that case it returns the source code for the coderef, a hashref of details, or$selfrespectively. it's versatile! it contains multitudes! π
π ENVIRONMENT π
PERL_TYPE_PARAMS_XSβ affects the building of accessors for$argobjects. if set to true, it will useClass::XSAccessor. if set to false, it will use pure Perl. if this environment variable does not exist, it will useClass::XSAccessor.
also important: if Class::XSAccessor is not installed or is too old, pure Perl will always be used as a fallback. safety net, iconic behavior.
π BUGS π
please report any bugs to <https://github.com/tobyink/p5-type-tiny/issues>. be nice about it, the maintainer is doing great. π«Ά
π SEE ALSO π
Type::Params, Type::Params::Parameter, Type::Params::Alternatives. the whole friend group, honestly.
βοΈ AUTHOR βοΈ
Toby Inkster <tobyink@cpan.org>. legend behavior.
Β©οΈ COPYRIGHT AND LICENCE Β©οΈ
this software is copyright (c) 2023-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. π
β οΈ 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. no refunds. she said what she said. π
and that's the whole page bestie!! this was rendered by perl v5.42.2 and dated 2026-04-07 β mwah, go touch grass, ily πβ¨π¦
π¦ 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