{
    "content": [
        {
            "type": "text",
            "text": "# Type::Tiny (perldoc)\n\n## NAME\n\nType::Tiny - tiny, yet Moo(se)-compatible type constraint\n\n## SYNOPSIS\n\nuse v5.12;\nuse strict;\nuse warnings;\npackage Horse {\nuse Moo;\nuse Types::Standard qw( Str Int Enum ArrayRef Object );\nuse Type::Params qw( compile );\nuse namespace::autoclean;\nhas name => (\nis       => 'ro',\nisa      => Str,\nrequired => 1,\n);\nhas gender => (\nis       => 'ro',\nisa      => Enum[qw( f m )],\n);\nhas age => (\nis       => 'rw',\nisa      => Int->where( '$ >= 0' ),\n);\nhas children => (\nis       => 'ro',\nisa      => ArrayRef[Object],\ndefault  => sub { return [] },\n);\nsub addchild {\nstate $check = compile( Object, Object );  # method signature\nmy ($self, $child) = $check->(@);         # unpack @\npush @{ $self->children }, $child;\nreturn $self;\n}\n}\npackage main;\nmy $boldruler = Horse->new(\nname    => \"Bold Ruler\",\ngender  => 'm',\nage     => 16,\n);\nmy $secretariat = Horse->new(\nname    => \"Secretariat\",\ngender  => 'm',\nage     => 0,\n);\n$boldruler->addchild( $secretariat );\n\n## DESCRIPTION\n\nThis documents the internals of the Type::Tiny class. Type::Tiny::Manual is a better starting\nplace if you're new.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **STATUS**\n- **DESCRIPTION** (7 subsections)\n- **BUGS**\n- **SEE ALSO**\n- **AUTHOR**\n- **THANKS**\n- **COPYRIGHT AND LICENCE**\n- **DISCLAIMER OF WARRANTIES**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Type::Tiny",
        "section": "",
        "mode": "perldoc",
        "summary": "Type::Tiny - tiny, yet Moo(se)-compatible type constraint",
        "synopsis": "use v5.12;\nuse strict;\nuse warnings;\npackage Horse {\nuse Moo;\nuse Types::Standard qw( Str Int Enum ArrayRef Object );\nuse Type::Params qw( compile );\nuse namespace::autoclean;\nhas name => (\nis       => 'ro',\nisa      => Str,\nrequired => 1,\n);\nhas gender => (\nis       => 'ro',\nisa      => Enum[qw( f m )],\n);\nhas age => (\nis       => 'rw',\nisa      => Int->where( '$ >= 0' ),\n);\nhas children => (\nis       => 'ro',\nisa      => ArrayRef[Object],\ndefault  => sub { return [] },\n);\nsub addchild {\nstate $check = compile( Object, Object );  # method signature\nmy ($self, $child) = $check->(@);         # unpack @\npush @{ $self->children }, $child;\nreturn $self;\n}\n}\npackage main;\nmy $boldruler = Horse->new(\nname    => \"Bold Ruler\",\ngender  => 'm',\nage     => 16,\n);\nmy $secretariat = Horse->new(\nname    => \"Secretariat\",\ngender  => 'm',\nage     => 0,\n);\n$boldruler->addchild( $secretariat );",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 55,
                "subsections": []
            },
            {
                "name": "STATUS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 33,
                "subsections": [
                    {
                        "name": "Constructor",
                        "lines": 3
                    },
                    {
                        "name": "Attributes",
                        "lines": 162
                    },
                    {
                        "name": "Methods",
                        "lines": 313
                    },
                    {
                        "name": "Overloading",
                        "lines": 23
                    },
                    {
                        "name": "Constants",
                        "lines": 3
                    },
                    {
                        "name": "Package Variables",
                        "lines": 26
                    },
                    {
                        "name": "Environment",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 19,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "THANKS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENCE",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "DISCLAIMER OF WARRANTIES",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Type::Tiny - tiny, yet Moo(se)-compatible type constraint\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use v5.12;\nuse strict;\nuse warnings;\n\npackage Horse {\nuse Moo;\nuse Types::Standard qw( Str Int Enum ArrayRef Object );\nuse Type::Params qw( compile );\nuse namespace::autoclean;\n\nhas name => (\nis       => 'ro',\nisa      => Str,\nrequired => 1,\n);\nhas gender => (\nis       => 'ro',\nisa      => Enum[qw( f m )],\n);\nhas age => (\nis       => 'rw',\nisa      => Int->where( '$ >= 0' ),\n);\nhas children => (\nis       => 'ro',\nisa      => ArrayRef[Object],\ndefault  => sub { return [] },\n);\n\nsub addchild {\nstate $check = compile( Object, Object );  # method signature\n\nmy ($self, $child) = $check->(@);         # unpack @\npush @{ $self->children }, $child;\n\nreturn $self;\n}\n}\n\npackage main;\n\nmy $boldruler = Horse->new(\nname    => \"Bold Ruler\",\ngender  => 'm',\nage     => 16,\n);\n\nmy $secretariat = Horse->new(\nname    => \"Secretariat\",\ngender  => 'm',\nage     => 0,\n);\n\n$boldruler->addchild( $secretariat );\n",
                "subsections": []
            },
            "STATUS": {
                "content": "This module is covered by the Type-Tiny stability policy.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This documents the internals of the Type::Tiny class. Type::Tiny::Manual is a better starting\nplace if you're new.\n\nType::Tiny is a small class for creating Moose-like type constraint objects which are compatible\nwith Moo, Moose and Mouse.\n\nuse Scalar::Util qw(lookslikenumber);\nuse Type::Tiny;\n\nmy $NUM = \"Type::Tiny\"->new(\nname       => \"Number\",\nconstraint => sub { lookslikenumber($) },\nmessage    => sub { \"$ ain't a number\" },\n);\n\npackage Ermintrude {\nuse Moo;\nhas favouritenumber => (is => \"ro\", isa => $NUM);\n}\n\npackage Bullwinkle {\nuse Moose;\nhas favouritenumber => (is => \"ro\", isa => $NUM);\n}\n\npackage Maisy {\nuse Mouse;\nhas favouritenumber => (is => \"ro\", isa => $NUM);\n}\n\nMaybe now we won't need to have separate MooseX, MouseX and MooX versions of everything? We can\nbut hope...\n",
                "subsections": [
                    {
                        "name": "Constructor",
                        "content": "\"new(%attributes)\"\nMoose-style constructor function.\n"
                    },
                    {
                        "name": "Attributes",
                        "content": "Attributes are named values that may be passed to the constructor. For each attribute, there is\na corresponding reader method. For example:\n\nmy $type = Type::Tiny->new( name => \"Foo\" );\nprint $type->name, \"\\n\";   # says \"Foo\"\n\nImportant attributes\nThese are the attributes you are likely to be most interested in providing when creating your\nown type constraints, and most interested in reading when dealing with type constraint objects.\n\n\"constraint\"\nCoderef to validate a value ($) against the type constraint. The coderef will not be called\nunless the value is known to pass any parent type constraint (see \"parent\" below).\n\nAlternatively, a string of Perl code checking $ can be passed as a parameter to the\nconstructor, and will be converted to a coderef.\n\nDefaults to \"sub { 1 }\" - i.e. a coderef that passes all values.\n\n\"parent\"\nOptional attribute; parent type constraint. For example, an \"Integer\" type constraint might\nhave a parent \"Number\".\n\nIf provided, must be a Type::Tiny object.\n\n\"inlined\"\nA coderef which returns a string of Perl code suitable for inlining this type. Optional.\n\n(The coderef will be called in list context and can actually return a list of strings which\nwill be joined with \"&&\". If the first item on the list is undef, it will be substituted\nwith the type's parent's inline check.)\n\nIf \"constraint\" (above) is a coderef generated via Sub::Quote, then Type::Tiny *may* be able\nto automatically generate \"inlined\" for you. If \"constraint\" (above) is a string, it will be\nable to.\n\n\"name\"\nThe name of the type constraint. These need to conform to certain naming rules (they must\nbegin with an uppercase letter and continue using only letters, digits 0-9 and underscores).\n\nOptional; if not supplied will be an anonymous type constraint.\n\n\"displayname\"\nA name to display for the type constraint when stringified. These don't have to conform to\nany naming rules. Optional; a default name will be calculated from the \"name\".\n\n\"library\"\nThe package name of the type library this type is associated with. Optional. Informational\nonly: setting this attribute does not install the type into the package.\n\n\"deprecated\"\nOptional boolean indicating whether a type constraint is deprecated. Type::Library will\nissue a warning if you attempt to import a deprecated type constraint, but otherwise the\ntype will continue to function as normal. There will not be deprecation warnings every time\nyou validate a value, for instance. If omitted, defaults to the parent's deprecation status\n(or false if there's no parent).\n\n\"message\"\nCoderef that returns an error message when $ does not validate against the type constraint.\nOptional (there's a vaguely sensible default.)\n\n\"coercion\"\nA Type::Coercion object associated with this type.\n\nGenerally speaking this attribute should not be passed to the constructor; you should rely\non the default lazily-built coercion object.\n\nYou may pass \"coercion => 1\" to the constructor to inherit coercions from the constraint's\nparent. (This requires the parent constraint to have a coercion.)\n\n\"sorter\"\nA coderef which can be passed two values conforming to this type constraint and returns -1,\n0, or 1 to put them in order. Alternatively an arrayref containing a pair of coderefs — a\nsorter and a pre-processor for the Schwarzian transform. Optional.\n\nThe idea is to allow for:\n\n@sorted = Int->sort( 2, 1, 11 );    # => 1, 2, 11\n@sorted = Str->sort( 2, 1, 11 );    # => 1, 11, 2\n\n\"mymethods\"\nExperimental hashref of additional methods that can be called on the type constraint object.\n\nAttributes related to parameterizable and parameterized types\nThe following additional attributes are used for parameterizable (e.g. \"ArrayRef\") and\nparameterized (e.g. \"ArrayRef[Int]\") type constraints. Unlike Moose, these aren't handled by\nseparate subclasses.\n\n\"constraintgenerator\"\nCoderef that is called when a type constraint is parameterized. When called, it is passed\nthe list of parameters, though any parameter which looks like a foreign type constraint\n(Moose type constraints, Mouse type constraints, etc, *and coderefs(!!!)*) is first coerced\nto a native Type::Tiny object.\n\nNote that for compatibility with the Moose API, the base type is *not* passed to the\nconstraint generator, but can be found in the package variable\n$Type::Tiny::parameterizetype. The first parameter is also available as $.\n\nTypes *can* be parameterized with an empty parameter list. For example, in Types::Standard,\n\"Tuple\" is just an alias for \"ArrayRef\" but \"Tuple[]\" will only allow zero-length arrayrefs\nto pass the constraint. If you wish \"YourType\" and \"YourType[]\" to mean the same thing, then\ndo:\n\nreturn $Type::Tiny::parameterizetype unless @;\n\nThe constraint generator should generate and return a new constraint coderef based on the\nparameters. Alternatively, the constraint generator can return a fully-formed Type::Tiny\nobject, in which case the \"namegenerator\", \"inlinegenerator\", and \"coerciongenerator\"\nattributes documented below are ignored.\n\nOptional; providing a generator makes this type into a parameterizable type constraint. If\nthere is no generator, attempting to parameterize the type constraint will throw an\nexception.\n\n\"namegenerator\"\nA coderef which generates a new displayname based on parameters. Called with the same\nparameters and package variables as the \"constraintgenerator\". Expected to return a string.\n\nOptional; the default is reasonable.\n\n\"inlinegenerator\"\nA coderef which generates a new inlining coderef based on parameters. Called with the same\nparameters and package variables as the \"constraintgenerator\". Expected to return a\ncoderef.\n\nOptional.\n\n\"coerciongenerator\"\nA coderef which generates a new Type::Coercion object based on parameters. Called with the\nsame parameters and package variables as the \"constraintgenerator\". Expected to return a\nblessed object.\n\nOptional.\n\n\"deepexplanation\"\nThis API is not finalized. Coderef used by Error::TypeTiny::Assertion to peek inside\nparameterized types and figure out why a value doesn't pass the constraint.\n\n\"parameters\"\nIn parameterized types, returns an arrayref of the parameters.\n\nLazy generated attributes\nThe following attributes should not be usually passed to the constructor; unless you're doing\nsomething especially unusual, you should rely on the default lazily-built return values.\n\n\"compiledcheck\"\nCoderef to validate a value ($[0]) against the type constraint. This coderef is expected to\nalso handle all validation for the parent type constraints.\n\n\"complementarytype\"\nA complementary type for this type. For example, the complementary type for an integer type\nwould be all things that are not integers, including floating point numbers, but also\nalphabetic strings, arrayrefs, filehandles, etc.\n\n\"moosetype\", \"mousetype\"\nObjects equivalent to this type constraint, but as a Moose::Meta::TypeConstraint or\nMouse::Meta::TypeConstraint.\n\nIt should rarely be necessary to obtain a Moose::Meta::TypeConstraint object from Type::Tiny\nbecause the Type::Tiny object itself should be usable pretty much anywhere a\nMoose::Meta::TypeConstraint is expected.\n"
                    },
                    {
                        "name": "Methods",
                        "content": "Predicate methods\nThese methods return booleans indicating information about the type constraint. They are each\ntightly associated with a particular attribute. (See \"Attributes\".)\n\n\"hasparent\", \"haslibrary\", \"hasinlined\", \"hasconstraintgenerator\", \"hasinlinegenerator\",\n\"hascoerciongenerator\", \"hasparameters\", \"hasmessage\", \"hasdeepexplanation\", \"hassorter\"\nSimple Moose-style predicate methods indicating the presence or absence of an attribute.\n\n\"hascoercion\"\nPredicate method with a little extra DWIM. Returns false if the coercion is a no-op.\n\n\"isanon\"\nReturns true iff the type constraint does not have a \"name\".\n\n\"isparameterized\", \"isparameterizable\"\nIndicates whether a type has been parameterized (e.g. \"ArrayRef[Int]\") or could potentially\nbe (e.g. \"ArrayRef\").\n\n\"hasparameterizedfrom\"\nUseless alias for \"isparameterized\".\n\nValidation and coercion\nThe following methods are used for coercing and validating values against a type constraint:\n\n\"check($value)\"\nReturns true iff the value passes the type constraint.\n\n\"validate($value)\"\nReturns the error message for the value; returns an explicit undef if the value passes the\ntype constraint.\n\n\"assertvalid($value)\"\nLike \"check($value)\" but dies if the value does not pass the type constraint.\n\nYes, that's three very similar methods. Blame Moose::Meta::TypeConstraint whose API I'm\nattempting to emulate. :-)\n\n\"assertreturn($value)\"\nLike \"assertvalid($value)\" but returns the value if it passes the type constraint.\n\nThis seems a more useful behaviour than \"assertvalid($value)\". I would have just changed\n\"assertvalid($value)\" to do this, except that there are edge cases where it could break\nMoose compatibility.\n\n\"getmessage($value)\"\nReturns the error message for the value; even if the value passes the type constraint.\n\n\"validateexplain($value, $varname)\"\nLike \"validate\" but instead of a string error message, returns an arrayref of strings\nexplaining the reasoning why the value does not meet the type constraint, examining parent\ntypes, etc.\n\nThe $varname is an optional string like '$foo' indicating the name of the variable being\nchecked.\n\n\"coerce($value)\"\nAttempt to coerce $value to this type.\n\n\"assertcoerce($value)\"\nAttempt to coerce $value to this type. Throws an exception if this is not possible.\n\nChild type constraint creation and parameterization\nThese methods generate new type constraint objects that inherit from the constraint they are\ncalled upon:\n\n\"createchildtype(%attributes)\"\nConstruct a new Type::Tiny object with this object as its parent.\n\n\"where($coderef)\"\nShortcut for creating an anonymous child type constraint. Use it like \"HashRef->where(sub {\nexists($->{name}) })\". That said, you can get a similar result using overloaded \"&\":\n\nHashRef & sub { exists($->{name}) }\n\nLike the \"constraint\" attribute, this will accept a string of Perl code:\n\nHashRef->where('exists($->{name})')\n\n\"childtypeclass\"\nThe class that createchildtype will construct by default.\n\n\"parameterize(@parameters)\"\nCreates a new parameterized type; throws an exception if called on a non-parameterizable\ntype.\n\n\"of(@parameters)\"\nA cute alias for \"parameterize\". Use it like \"ArrayRef->of(Int)\".\n\n\"pluscoercions($type1, $code1, ...)\"\nShorthand for creating a new child type constraint with the same coercions as this one, but\nthen adding some extra coercions (at a higher priority than the existing ones).\n\n\"plusfallbackcoercions($type1, $code1, ...)\"\nLike \"pluscoercions\", but added at a lower priority.\n\n\"minuscoercions($type1, ...)\"\nShorthand for creating a new child type constraint with fewer type coercions.\n\n\"nocoercions\"\nShorthand for creating a new child type constraint with no coercions at all.\n\nType relationship introspection methods\nThese methods allow you to determine a type constraint's relationship to other type constraints\nin an organised hierarchy:\n\n\"equals($other)\", \"issubtypeof($other)\", \"issupertypeof($other)\", \"isatypeof($other)\"\nCompare two types. See Moose::Meta::TypeConstraint for what these all mean. (OK, Moose\ndoesn't define \"issupertypeof\", but you get the idea, right?)\n\nNote that these have a slightly DWIM side to them. If you create two Type::Tiny::Class\nobjects which test the same class, they're considered equal. And:\n\nmy $subtypeofNum = Types::Standard::Num->createchildtype;\nmy $subtypeofInt = Types::Standard::Int->createchildtype;\n$subtypeofInt->issubtypeof( $subtypeofNum );  # true\n\n\"strictlyequals($other)\", \"isstrictlysubtypeof($other)\", \"isstrictlysupertypeof($other)\",\n\"isstrictlyatypeof($other)\"\nStricter versions of the type comparison functions. These only care about explicit\ninheritance via \"parent\".\n\nmy $subtypeofNum = Types::Standard::Num->createchildtype;\nmy $subtypeofInt = Types::Standard::Int->createchildtype;\n$subtypeofInt->isstrictlysubtypeof( $subtypeofNum );  # false\n\n\"parents\"\nReturns a list of all this type constraint's ancestor constraints. For example, if called on\nthe \"Str\" type constraint would return the list \"(Value, Defined, Item, Any)\".\n\n*Due to a historical misunderstanding, this differs from the Moose implementation of the\n\"parents\" method. In Moose, \"parents\" only returns the immediate parent type constraints,\nand because type constraints only have one immediate parent, this is effectively an alias\nfor \"parent\". The extension module MooseX::Meta::TypeConstraint::Intersection is the only\nplace where multiple type constraints are returned; and they are returned as an arrayref in\nviolation of the base class' documentation. I'm keeping my behaviour as it seems more\nuseful.*\n\n\"findparent($coderef)\"\nLoops through the parent type constraints *including the invocant itself* and returns the\nnearest ancestor type constraint where the coderef evaluates to true. Within the coderef the\nancestor currently being checked is $. Returns undef if there is no match.\n\nIn list context also returns the number of type constraints which had been looped through\nbefore the matching constraint was found.\n\n\"findconstrainingtype\"\nFinds the nearest ancestor type constraint (including the type itself) which has a\n\"constraint\" coderef.\n\nEquivalent to:\n\n$type->findparent(sub { not $->isnullconstraint })\n\n\"coercibles\"\nReturn a type constraint which is the union of type constraints that can be coerced to this\none (including this one). If this type constraint has no coercions, returns itself.\n\n\"typeparameter\"\nIn parameterized type constraints, returns the first item on the list of parameters;\notherwise returns undef. For example:\n\n( ArrayRef[Int] )->typeparameter;    # returns Int\n( ArrayRef[Int] )->parent;            # returns ArrayRef\n\nNote that parameterizable type constraints can perfectly legitimately take multiple\nparameters (several of the parameterizable type constraints in Types::Standard do). This\nmethod only returns the first such parameter. \"Attributes related to parameterizable and\nparameterized types\" documents the \"parameters\" attribute, which returns an arrayref of all\nthe parameters.\n\n\"parameterizedfrom\"\nHarder to spell alias for \"parent\" that only works for parameterized types.\n\n*Hint for people subclassing Type::Tiny:* Since version 1.006000, the methods for determining\nsubtype, supertype, and type equality should *not* be overridden in subclasses of Type::Tiny.\nThis is because of the problem of diamond inheritance. If X and Y are both subclasses of\nType::Tiny, they *both* need to be consulted to figure out how type constraints are related; not\njust one of them should be overriding these methods. See the source code for Type::Tiny::Enum\nfor an example of how subclasses can give hints about type relationships to Type::Tiny. Summary:\npush a coderef onto @Type::Tiny::CMP. This coderef will be passed two type constraints. It\nshould then return one of the constants Type::Tiny::CMPSUBTYPE (first type is a subtype of\nsecond type), Type::Tiny::CMPSUPERTYPE (second type is a subtype of first type),\nType::Tiny::CMPEQUAL (the two types are exactly the same), Type::Tiny::CMPEQUIVALENT (the two\ntypes are effectively the same), or Type::Tiny::CMPUNKNOWN (your coderef couldn't establish any\nrelationship).\n\nType relationship introspection function\n\"Type::Tiny::cmp($type1, $type2)\"\nThe subtype/supertype relationship between types results in a partial ordering of type\nconstraints.\n\nThis function will return one of the constants: Type::Tiny::CMPSUBTYPE (first type is a\nsubtype of second type), Type::Tiny::CMPSUPERTYPE (second type is a subtype of first type),\nType::Tiny::CMPEQUAL (the two types are exactly the same), Type::Tiny::CMPEQUIVALENT (the\ntwo types are effectively the same), or Type::Tiny::CMPUNKNOWN (couldn't establish any\nrelationship). In numeric contexts, these evaluate to -1, 1, 0, 0, and 0, making it\npotentially usable with \"sort\" (though you may need to silence warnings about treating the\nempty string as a numeric value).\n\nList processing methods\n\"grep(@list)\"\nFilters a list to return just the items that pass the type check.\n\n@integers = Int->grep(@list);\n\n\"first(@list)\"\nFilters the list to return the first item on the list that passes the type check, or undef\nif none do.\n\n$firstlady = Woman->first(@people);\n\n\"map(@list)\"\nCoerces a list of items. Only works on types which have a coercion.\n\n@truths = Bool->map(@list);\n\n\"sort(@list)\"\nSorts a list of items according to the type's preferred sorting mechanism, or if the type\ndoesn't have a sorter coderef, uses the parent type. If no ancestor type constraint has a\nsorter, throws an exception. The \"Str\", \"StrictNum\", \"LaxNum\", and \"Enum\" type constraints\ninclude sorters.\n\n@sortednumbers = Num->sort( Num->grep(@list) );\n\n\"rsort(@list)\"\nLike \"sort\" but backwards.\n\n\"any(@list)\"\nReturns true if any of the list match the type.\n\nif ( Int->any(@numbers) ) {\nsay \"there was at least one integer\";\n}\n\n\"all(@list)\"\nReturns true if all of the list match the type.\n\nif ( Int->all(@numbers) ) {\nsay \"they were all integers\";\n}\n\n\"assertany(@list)\"\nLike \"any\" but instead of returning a boolean, returns the entire original list if any item\non it matches the type, and dies if none does.\n\n\"assertall(@list)\"\nLike \"all\" but instead of returning a boolean, returns the original list if all items on it\nmatch the type, but dies as soon as it finds one that does not.\n\nInlining methods\nThe following methods are used to generate strings of Perl code which may be pasted into stringy\n\"eval\"uated subs to perform type checks:\n\n\"canbeinlined\"\nReturns boolean indicating if this type can be inlined.\n\n\"inlinecheck($varname)\"\nCreates a type constraint check for a particular variable as a string of Perl code. For\nexample:\n\nprint( Types::Standard::Num->inlinecheck('$foo') );\n\nprints the following output:\n\n(!ref($foo) && Scalar::Util::lookslikenumber($foo))\n\nFor Moose-compat, there is an alias \"inlinecheck\" for this method.\n\n\"inlineassert($varname)\"\nMuch like \"inlinecheck\" but outputs a statement of the form:\n\n... or die ...;\n\nCan also be called line \"inlineassert($varname, $typevarname, %extras)\". In this case, it\nwill generate a string of code that may include $typevarname which is supposed to be the\nname of a variable holding the type itself. (This is kinda complicated, but it allows a\nuseful string to still be produced if the type is not inlineable.) The %extras are\nadditional options to be passed to Error::TypeTiny::Assertion's constructor and must be\nkey-value pairs of strings only, no references or undefs.\n\nOther methods\n\"qualifiedname\"\nFor non-anonymous type constraints that have a library, returns a qualified \"MyLib::MyType\"\nsort of name. Otherwise, returns the same as \"name\".\n\n\"isa($class)\", \"can($method)\", \"AUTOLOAD(@args)\"\nIf Moose is loaded, then the combination of these methods is used to mock a\nMoose::Meta::TypeConstraint.\n\nIf Mouse is loaded, then \"isa\" mocks Mouse::Meta::TypeConstraint.\n\n\"DOES($role)\"\nOverridden to advertise support for various roles.\n\nSee also Type::API::Constraint, etc.\n\n\"TIESCALAR\", \"TIEARRAY\", \"TIEHASH\"\nThese are provided as hooks that wrap Type::Tie. (Type::Tie is distributed separately, and\ncan be used with non-Type::Tiny type constraints too.) They allow the following to work:\n\nuse Types::Standard qw(Int);\ntie my @list, Int;\npush @list, 123, 456;   # ok\npush @list, \"Hello\";    # dies\n\nThe following methods exist for Moose/Mouse compatibility, but do not do anything useful.\n\n\"compiletypeconstraint\"\n\"handoptimizedtypeconstraint\"\n\"hashandoptimizedtypeconstraint\"\n\"inlineenvironment\"\n\"meta\"\n"
                    },
                    {
                        "name": "Overloading",
                        "content": "*   Stringification is overloaded to return the qualified name.\n\n*   Boolification is overloaded to always return true.\n\n*   Coderefification is overloaded to call \"assertreturn\".\n\n*   On Perl 5.10.1 and above, smart match is overloaded to call \"check\".\n\n*   The \"==\" operator is overloaded to call \"equals\".\n\n*   The \"<\" and \">\" operators are overloaded to call \"issubtypeof\" and \"issupertypeof\".\n\n*   The \"~\" operator is overloaded to call \"complementarytype\".\n\n*   The \"|\" operator is overloaded to build a union of two type constraints. See\nType::Tiny::Union.\n\n*   The \"&\" operator is overloaded to build the intersection of two type constraints. See\nType::Tiny::Intersection.\n\nPrevious versions of Type::Tiny would overload the \"+\" operator to call \"pluscoercions\" or\n\"plusfallbackcoercions\" as appropriate. Support for this was dropped after 0.040.\n"
                    },
                    {
                        "name": "Constants",
                        "content": "\"Type::Tiny::SUPPORTSMARTMATCH\"\nIndicates whether the smart match overload is supported on your version of Perl.\n"
                    },
                    {
                        "name": "Package Variables",
                        "content": "$Type::Tiny::DD\nThis undef by default but may be set to a coderef that Type::Tiny and related modules will\nuse to dump data structures in things like error messages.\n\nOtherwise Type::Tiny uses it's own routine to dump data structures. $DD may then be set to a\nnumber to limit the lengths of the dumps. (Default limit is 72.)\n\nThis is a package variable (rather than get/set class methods) to allow for easy\nlocalization.\n\n$Type::Tiny::AvoidCallbacks\nIf this variable is set to true (you should usually do it in a \"local\" scope), it acts as a\nhint for type constraints, when generating inlined code, to avoid making any callbacks to\nvariables and functions defined outside the inlined code itself.\n\nThis should have the effect that \"$type->inlinecheck('$foo')\" will return a string of code\ncapable of checking the type on Perl installations that don't have Type::Tiny installed.\nThis is intended to allow Type::Tiny to be used with things like Mite.\n\nThe variable works on the honour system. Types need to explicitly check it and decide to\ngenerate different code based on its truth value. The bundled types in Types::Standard,\nTypes::Common::Numeric, and Types::Common::String all do. (StrMatch is sometimes unable to,\nand will issue a warning if it needs to rely on callbacks when asked not to.)\n\nMost normal users can ignore this.\n"
                    },
                    {
                        "name": "Environment",
                        "content": "\"PERLTYPETINYXS\"\nCurrently this has more effect on Types::Standard than Type::Tiny. In future it may be used\nto trigger or suppress the loading XS implementations of parts of Type::Tiny.\n"
                    }
                ]
            },
            "BUGS": {
                "content": "Please report any bugs to <https://github.com/tobyink/p5-type-tiny/issues>.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "The Type::Tiny homepage <https://typetiny.toby.ink/>.\n\nType::Tiny::Manual, Type::API.\n\nType::Library, Type::Utils, Types::Standard, Type::Coercion.\n\nType::Tiny::Class, Type::Tiny::Role, Type::Tiny::Duck, Type::Tiny::Enum, Type::Tiny::Union,\nType::Tiny::Intersection.\n\nMoose::Meta::TypeConstraint, Mouse::Meta::TypeConstraint.\n\nType::Params.\n\nType::Tiny on GitHub <https://github.com/tobyink/p5-type-tiny>, Type::Tiny on Travis-CI\n<https://travis-ci.com/tobyink/p5-type-tiny>, Type::Tiny on AppVeyor\n<https://ci.appveyor.com/project/tobyink/p5-type-tiny>, Type::Tiny on Codecov\n<https://codecov.io/gh/tobyink/p5-type-tiny>, Type::Tiny on Coveralls\n<https://coveralls.io/github/tobyink/p5-type-tiny>.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Toby Inkster <tobyink@cpan.org>.\n",
                "subsections": []
            },
            "THANKS": {
                "content": "Thanks to Matt S Trout for advice on Moo integration.\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENCE": {
                "content": "This software is copyright (c) 2013-2014, 2017-2021 by Toby Inkster.\n\nThis is free software; you can redistribute it and/or modify it under the same terms as the Perl\n5 programming language system itself.\n",
                "subsections": []
            },
            "DISCLAIMER OF WARRANTIES": {
                "content": "THIS PACKAGE IS PROVIDED \"AS IS\" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,\nWITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.\n",
                "subsections": []
            }
        }
    }
}