NAME
Type::Params::Signature - internal representation of a function signature
STATUS
This module is not covered by the Type-Tiny stability policy.
DESCRIPTION
This is mostly internal code, but can be used to provide basic introspection for signatures.
Constructors
Attributes
All attributes are read-only.
packageClassName-
The package we're providing a signature for. Will be used to look up any stringy type names.
subnameStr-
The sub we're providing a signature for.
descriptionStrmethodArrayRef[InstanceOf['Type::Params::Parameter']]headArrayRef[InstanceOf['Type::Params::Parameter']]tailArrayRef[InstanceOf['Type::Params::Parameter']]parametersArrayRef[InstanceOf['Type::Params::Parameter']]slurpyInstanceOf['Type::Params::Parameter']on_dieCodeRefstrictnessBool|ScalarRefnextCodeRefgoto_nextCodeRef-
Alias for
next. can_shortcutBool-
Indicates whether the signature has no potential to alter
@_allowing it to be returned without being copied if type checks pass. Generally speaking, you should not provide this to the constructor and rely on Type::Params::Signature to figure it out. coderefInstanceOf['Eval::TypeTiny::CodeAccumulator']-
You probably don't want to provide this to the constructor. The whole point of this module is to build it for you!
Attributes related to named parameters
is_namedBoolallow_dashBoolblessBool|ClassNameclassClassNameconstructorStrclass_attributesHashRef-
HashRef suitable for passing to the
importmethod of Class::XSAccessor. A default will be generated based onparameters named_to_listArrayRef-
Can be coerced from a bool based on
parameters. list_to_namedBooloo_traceBool-
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.
positionalorposArrayRefnamedArrayRefmultipleormultiArrayRefreturnsBool-
Shortcut for setting
returns_scalarandreturns_listsimultaneously. want_sourceBoolwant_detailsBoolwant_objectBoolrationalize_slurpiesBool
Methods
Predicates
Predicate methods return true/false to indicate the presence or absence of attributes.
has_descriptionhas_headhas_tailhas_parametershas_slurpyhas_on_diehas_strictnesshas_returns_scalarhas_returns_list
Class making methods
These methods will be called automatically during object construction and should not typically be called. They are public methods in case it is desired to subclass Type::Params::Signature.
make_class_pp-
Builds the class specified in
blessby evaluating Perl code. make_class_xs-
Builds the class specified in
blessusing Class::XSAccessor. make_class-
Calls either
make_class_ppormake_class_xs. make_class_pp_code-
Generates the code for
make_class_pp.
Other methods
BUILD-
Called by the constructors. You should not call this.
return_wanted-
Normally returns the signature coderef, unless
want_source,want_details, orwant_objectwere provided to the constructor, in which case it will return the source code for the coderef, a hashref of details, or$self.
ENVIRONMENT
PERL_TYPE_PARAMS_XS-
Affects the building of accessors for
$argobjects. If set to true, will use Class::XSAccessor. If set to false, will use pure Perl. If this environment variable does not exist, will use Class::XSAccessor.If Class::XSAccessor is not installed or is too old, pure Perl will always be used as a fallback.
BUGS
Please report any bugs to https://github.com/tobyink/p5-type-tiny/issues.
SEE ALSO
Type::Params, Type::Params::Parameter, Type::Params::Alternatives.
AUTHOR
Toby Inkster <tobyink@cpan.org>.
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.
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.