HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/share/man/man3/Types::TypeTiny.3pm
.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" 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
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
.    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
.\" ========================================================================
.\"
.IX Title "Types::TypeTiny 3"
.TH Types::TypeTiny 3 "2021-07-31" "perl v5.26.3" "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"
Types::TypeTiny \- type constraints used internally by Type::Tiny
.SH "STATUS"
.IX Header "STATUS"
This module is covered by the
Type-Tiny stability policy.
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Dogfooding.
.PP
This isn't a real Type::Library\-based type library; that would involve
too much circularity. But it exports some type constraints which, while
designed for use within Type::Tiny, may be more generally useful.
.SS "Types"
.IX Subsection "Types"
.IP "\(bu" 4
\&\fBStringLike\fR
.Sp
Accepts strings and objects overloading stringification.
.IP "\(bu" 4
\&\fBHashLike[`a]\fR
.Sp
Accepts hashrefs and objects overloading hashification.
.Sp
Since Types::TypeTiny 1.012, may be parameterized with another type
constraint like \fBHashLike[Int]\fR.
.IP "\(bu" 4
\&\fBArrayLike[`a]\fR
.Sp
Accepts arrayrefs and objects overloading arrayfication.
.Sp
Since Types::TypeTiny 1.012, may be parameterized with another type
constraint like \fBArrayLike[Int]\fR.
.IP "\(bu" 4
\&\fBCodeLike\fR
.Sp
Accepts coderefs and objects overloading codification.
.IP "\(bu" 4
\&\fBTypeTiny\fR
.Sp
Accepts blessed Type::Tiny objects.
.IP "\(bu" 4
\&\fB_ForeignTypeConstraint\fR
.Sp
Any reference which to_TypeTiny recognizes as something that can be coerced
to a Type::Tiny object.
.Sp
Yes, the underscore is included.
.SS "Coercion Functions"
.IX Subsection "Coercion Functions"
.ie n .IP """to_TypeTiny($constraint)""" 4
.el .IP "\f(CWto_TypeTiny($constraint)\fR" 4
.IX Item "to_TypeTiny($constraint)"
Promotes (or \*(L"demotes\*(R" if you prefer) a Moose::Meta::TypeConstraint object
to a Type::Tiny object.
.Sp
Can also handle Validation::Class objects. Type constraints built from 
Validation::Class objects deliberately \fIignore\fR field filters when they
do constraint checking (and go to great lengths to do so); using filters for
coercion only. (The behaviour of \f(CW\*(C`coerce\*(C'\fR if we don't do that is just too
weird!)
.Sp
Can also handle any object providing \f(CW\*(C`check\*(C'\fR and \f(CW\*(C`get_message\*(C'\fR methods.
(This includes Mouse::Meta::TypeConstraint objects.) If the object also
provides \f(CW\*(C`has_coercion\*(C'\fR and \f(CW\*(C`coerce\*(C'\fR methods, these will be used too.
.Sp
Can also handle coderefs (but not blessed coderefs or objects overloading
\&\f(CW\*(C`&{}\*(C'\fR). Coderefs are expected to return true iff \f(CW$_\fR passes the
constraint. If \f(CW$_\fR fails the type constraint, they may either return
false, or die with a helpful error message.
.SS "Methods"
.IX Subsection "Methods"
These are implemented so that \f(CW\*(C`Types::TypeTiny\->meta\->get_type($foo)\*(C'\fR
works, for rough compatibility with a real Type::Library type library.
.ie n .IP """meta""" 4
.el .IP "\f(CWmeta\fR" 4
.IX Item "meta"
.PD 0
.ie n .IP """type_names""" 4
.el .IP "\f(CWtype_names\fR" 4
.IX Item "type_names"
.ie n .IP """get_type($name)""" 4
.el .IP "\f(CWget_type($name)\fR" 4
.IX Item "get_type($name)"
.ie n .IP """has_type($name)""" 4
.el .IP "\f(CWhas_type($name)\fR" 4
.IX Item "has_type($name)"
.ie n .IP """coercion_names""" 4
.el .IP "\f(CWcoercion_names\fR" 4
.IX Item "coercion_names"
.ie n .IP """get_coercion($name)""" 4
.el .IP "\f(CWget_coercion($name)\fR" 4
.IX Item "get_coercion($name)"
.ie n .IP """has_coercion($name)""" 4
.el .IP "\f(CWhas_coercion($name)\fR" 4
.IX Item "has_coercion($name)"
.PD
.SH "BUGS"
.IX Header "BUGS"
Please report any bugs to
<https://github.com/tobyink/p5\-type\-tiny/issues>.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
Type::Tiny.
.SH "AUTHOR"
.IX Header "AUTHOR"
Toby Inkster <tobyink@cpan.org>.
.SH "COPYRIGHT AND LICENCE"
.IX Header "COPYRIGHT AND LICENCE"
This software is copyright (c) 2013\-2014, 2017\-2021 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"
\&\s-1THIS PACKAGE IS PROVIDED \*(L"AS IS\*(R" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\s0