.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Type::Params::Parameter 3" .TH Type::Params::Parameter 3 2025-07-14 "perl v5.42.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Type::Params::Parameter \- internal representation of a parameter in a function signature .SH STATUS .IX Header "STATUS" This module is not covered by the Type\-Tiny stability policy. .SH DESCRIPTION .IX Header "DESCRIPTION" This is mostly internal code, but can be used to provide basic introspection for signatures. .SS Constructor .IX Subsection "Constructor" .ie n .IP new(%attributes) 4 .el .IP \f(CWnew(%attributes)\fR 4 .IX Item "new(%attributes)" .SS Attributes .IX Subsection "Attributes" All attributes are read\-only. .ie n .IP """type"" \fBTypeTiny\fR" 4 .el .IP "\f(CWtype\fR \fBTypeTiny\fR" 4 .IX Item "type TypeTiny" Type constraint for the parameter. .ie n .IP """default"" \fBCodeRef|ScalarRef|Ref|Str|Undef\fR" 4 .el .IP "\f(CWdefault\fR \fBCodeRef|ScalarRef|Ref|Str|Undef\fR" 4 .IX Item "default CodeRef|ScalarRef|Ref|Str|Undef" A default for the parameter: either a coderef to generate a value, a reference to a string of Perl code to generate the value, an a reference to an empty array or empty hash, a literal string to use as a default, or a literal undef to use as a default. .ie n .IP """strictness"" \fBBool|ScalarRef\fR" 4 .el .IP "\f(CWstrictness\fR \fBBool|ScalarRef\fR" 4 .IX Item "strictness Bool|ScalarRef" A boolean indicating whether to be stricter with type checks, or a reference to a string of Perl code naming a Perl variable or constant which controls strict behaviour. .ie n .IP """clone"" \fBBool\fR" 4 .el .IP "\f(CWclone\fR \fBBool\fR" 4 .IX Item "clone Bool" The method for accessing this is called \f(CW\*(C`should_clone\*(C'\fR for no particular reason. .ie n .IP """coerce"" \fBBool\fR" 4 .el .IP "\f(CWcoerce\fR \fBBool\fR" 4 .IX Item "coerce Bool" Defaults to true if \f(CW\*(C`type\*(C'\fR has a coercion. .ie n .IP """optional"" \fBBool\fR" 4 .el .IP "\f(CWoptional\fR \fBBool\fR" 4 .IX Item "optional Bool" Defaults to true if there is a \f(CW\*(C`default\*(C'\fR or if \f(CW\*(C`type\*(C'\fR is a subtype of \&\fBOptional\fR. .ie n .IP """in_list"" \fBBool\fR" 4 .el .IP "\f(CWin_list\fR \fBBool\fR" 4 .IX Item "in_list Bool" Boolean that is only used when the signature has the \f(CW\*(C`list_to_named\*(C'\fR feature enabled. .ie n .IP """default_on_undef"" \fBBool\fR" 4 .el .IP "\f(CWdefault_on_undef\fR \fBBool\fR" 4 .IX Item "default_on_undef Bool" Should the default be triggered if the caller passes an explicit undef? .PP \fIAttributes related to named parameters\fR .IX Subsection "Attributes related to named parameters" .ie n .IP """name"" \fBStr\fR" 4 .el .IP "\f(CWname\fR \fBStr\fR" 4 .IX Item "name Str" .PD 0 .ie n .IP """alias"" \fBArrayRef[Str]\fR" 4 .el .IP "\f(CWalias\fR \fBArrayRef[Str]\fR" 4 .IX Item "alias ArrayRef[Str]" .ie n .IP """getter"" \fBStr\fR" 4 .el .IP "\f(CWgetter\fR \fBStr\fR" 4 .IX Item "getter Str" .ie n .IP """predicate"" \fBStr\fR" 4 .el .IP "\f(CWpredicate\fR \fBStr\fR" 4 .IX Item "predicate Str" .PD .SS Methods .IX Subsection "Methods" \fIPredicates\fR .IX Subsection "Predicates" .PP Predicate methods return true/false to indicate the presence or absence of attributes. .ie n .IP """has_type""" 4 .el .IP \f(CWhas_type\fR 4 .IX Item "has_type" .PD 0 .ie n .IP """has_default""" 4 .el .IP \f(CWhas_default\fR 4 .IX Item "has_default" .ie n .IP """has_strictness""" 4 .el .IP \f(CWhas_strictness\fR 4 .IX Item "has_strictness" .ie n .IP """has_name""" 4 .el .IP \f(CWhas_name\fR 4 .IX Item "has_name" .ie n .IP """has_alias""" 4 .el .IP \f(CWhas_alias\fR 4 .IX Item "has_alias" .PD .PP \fIOther methods\fR .IX Subsection "Other methods" .ie n .IP """might_supply_new_value""" 4 .el .IP \f(CWmight_supply_new_value\fR 4 .IX Item "might_supply_new_value" Indicates that the parameter can\*(Aqt simply be referenced within \f(CW@_\fR because a default value might be used, the given value might be coerced, or the given value might be cloned using Storable. .SH BUGS .IX Header "BUGS" Please report any bugs to . .SH "SEE ALSO" .IX Header "SEE ALSO" Type::Params, Type::Params::Signature. .SH AUTHOR .IX Header "AUTHOR" Toby Inkster . .SH "COPYRIGHT AND LICENCE" .IX Header "COPYRIGHT AND LICENCE" This software is copyright (c) 2023\-2025 by Toby Inkster. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. .SH "DISCLAIMER OF WARRANTIES" .IX Header "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.