{
    "mode": "perldoc",
    "parameter": "Types::TypeTiny",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Types%3A%3ATypeTiny/json",
    "generated": "2026-09-25T06:45:40Z",
    "sections": {
        "NAME": {
            "content": "Types::TypeTiny - type constraints used internally by Type::Tiny\n",
            "subsections": []
        },
        "STATUS": {
            "content": "This module is covered by the Type-Tiny stability policy.\n\nThe BoolLike type is currently unstable.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Dogfooding.\n\nThis isn't a real Type::Library-based type library; that would involve too much circularity. But\nit exports some type constraints which, while designed for use within Type::Tiny, may be more\ngenerally useful.\n",
            "subsections": [
                {
                    "name": "Types",
                    "content": "*   StringLike\n\nAccepts strings and objects overloading stringification.\n\n*   BoolLike\n\nAccepts undef, \"\", 0, 1; accepts any blessed object overloading \"bool\"; accepts any blessed\nobject overloading \"0+\" to return 0 or 1. (Needs to actually call the overloaded operation\nto check that.)\n\nWarning: an object which overloads \"0+\" without also turning on overload fallbacks may\nactually be useless as a practical boolean. But some common objects such as JSON::PP's\nbooleans overload \"0+\" instead of overloading \"bool\" (thankfully with fallbacks enabled!) so\nwe do need to support this.\n\nThe intention of this type is to be a version of Bool which also accepts common boolean\nobjects such as JSON::PP::Boolean. It is currently unstable and the exact definition of the\ntype may change to better implement that intended functionality.\n\n*   HashLike[`a]\n\nAccepts hashrefs and objects overloading hashification.\n\nSince Types::TypeTiny 1.012, may be parameterized with another type constraint like\nHashLike[Int].\n\n*   ArrayLike[`a]\n\nAccepts arrayrefs and objects overloading arrayfication.\n\nSince Types::TypeTiny 1.012, may be parameterized with another type constraint like\nArrayLike[Int].\n\n*   CodeLike\n\nAccepts coderefs and objects overloading codification.\n\n*   TypeTiny\n\nAccepts blessed Type::Tiny objects.\n\n*   ForeignTypeConstraint\n\nAny reference which toTypeTiny recognizes as something that can be coerced to a Type::Tiny\nobject.\n\nYes, the underscore is included.\n"
                },
                {
                    "name": "Coercion Functions",
                    "content": ""
                },
                {
                    "name": "to_TypeTiny",
                    "content": "Promotes (or \"demotes\" if you prefer) a \"foreign\" type constraint to a Type::Tiny object.\nCan handle:\n\n*   Moose types (including Moose::Meta::TypeConstraint objects and\nMooseX::Types::TypeDecorator objects).\n\n*   Mouse types (including Mouse::Meta::TypeConstraint objects).\n\n*   Validation::Class and Validation::Class::Simple objects.\n\n*   Types built using Type::Library::Compiler.\n\n*   Any object which provides \"check\" and \"getmessage\" methods. (This includes Specio and\nType::Nano types.) If the object provides \"hascoercion\" and coerce methods, these will\nbe used to handle quoting. If the object provides \"canbeinlined\" and \"inlinecheck\"\nmethods, these will be used to handling inlining. If the object provides a \"name\"\nmethod, this will be assumed to return the type name.\n\n*   Coderefs (but not blessed coderefs or objects overloading \"&{}\" unless they provide the\nmethods described above!) Coderefs are expected to return true iff $ passes the\nconstraint. If $ fails the type constraint, they may either return false, or die with a\nhelpful error message.\n\n*   Sub::Quote-enabled coderefs. These are handled the same way as above, but Type::Tiny\nwill consult Sub::Quote to determine if they can be inlined.\n"
                },
                {
                    "name": "Methods",
                    "content": "These are implemented so that \"Types::TypeTiny->meta->gettype($foo)\" works, for rough\ncompatibility with a real Type::Library type library.\n\n\"meta\"\n\"typenames\""
                },
                {
                    "name": "get_type",
                    "content": ""
                },
                {
                    "name": "has_type",
                    "content": "\"coercionnames\""
                },
                {
                    "name": "get_coercion",
                    "content": ""
                },
                {
                    "name": "has_coercion",
                    "content": ""
                }
            ]
        },
        "BUGS": {
            "content": "Please report any bugs to <https://github.com/tobyink/p5-type-tiny/issues>.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Type::Tiny.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Toby Inkster <tobyink@cpan.org>.\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENCE": {
            "content": "This software is copyright (c) 2013-2014, 2017-2023 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": []
        }
    },
    "summary": "Types::TypeTiny - type constraints used internally by Type::Tiny",
    "flags": [],
    "examples": [],
    "see_also": []
}