GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MooseX::Extended::Types(3) User Contributed Perl Documentation MooseX::Extended::Types(3)

MooseX::Extended::Types - Keep our type tools organized

version 0.35

    use MooseX::Extended;
    use MooseX::Extended::Types;
    use MooseX::Extended::Types qw(
      ArrayRef
      Dict
      Enum
      HashRef
      InstanceOf
      Str
      compile
    );

As a convenience, if you're using MooseX::Extended, you can do this:

    use MooseX::Extended types => [qw(
      ArrayRef
      Dict
      Enum
      HashRef
      InstanceOf
      Str
      compile
    )];

If you're brave:

    use MooseX::Extended types => ':all';

But that exports everything and it's easy to have surprising conflicts.

A basic set of useful types for "MooseX::Extended", as provided by Type::Tiny. Using these is preferred to using using strings due to runtime versus compile-time failures. For example:

    # fails at runtime, if ->name is set
    param name => ( isa => 'str' );
    # fails at compile-time
    param name => ( isa => str );

We automatically include the types from the following:

  • Types::Standard

    You can import them individually or with the ":Standard" tag:

        use MooseX::Extended::Types types => 'Str';
        use MooseX::Extended::Types types => [ 'Str', 'ArrayRef' ];
        use MooseX::Extended::Types types => ':Standard';
        

    Using the ":Standard" tag is equivalent to:

        use Types::Standard;
        

    No import list is supplied directly to the module, so non-default type functions must be asked for by name.

  • Types::Common::Numeric

    You can import them individually or with the ":Numeric" tag:

        use MooseX::Extended::Types types => 'Int';
        use MooseX::Extended::Types types => [ 'Int', 'NegativeOrZeroNum' ];
        use MooseX::Extended::Types types => ':Numeric';
        

    Using the ":Numeric" tag is equivalent to:

        use Types::Common::Numeric;
        

    No import list is supplied directly to the module, so non-default type functions must be asked for by name.

  • Types::Common::String

    You can import them individually or with the ":String" tag:

        use MooseX::Extended::Types types => 'NonEmptyStr';
        use MooseX::Extended::Types types => [ 'NonEmptyStr', 'UpperCaseStr' ];
        use MooseX::Extended::Types types => ':String';
        

    Using the ":String" tag is equivalent to:

        use Types::Common::String;
        

    No import list is supplied directly to the module, so non-default type functions must be asked for by name.

The following extra functions are exported on demand or if using the ":all" export tag (but you probably don't want to use that tag).

  • "compile"
  • "compile_named"
  • "multisig"
  • "validate"
  • "validate_named"
  • "compile_named_oo"
  • "Invocant"
  • "wrap_subs"
  • "wrap_methods"
  • "ArgsObject"

"slurpy"

Curtis "Ovid" Poe <curtis.poe@gmail.com>

This software is Copyright (c) 2022 by Curtis "Ovid" Poe.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)
2023-06-06 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.