Package Info

perl-MooseX-Types


Organise your Moose types in libraries


Development/Libraries/Perl

The type system provided by Moose effectively makes all of its builtin type global, as are any types you declare with Moose. This means that every module that declares a type named 'PositiveInt' is sharing the same type object. This can be a problem when different parts of the code base want to use the same name for different things.

This package lets you declare types using short names, but behind the scenes it namespaces all your type declarations, effectively prevent name clashes between packages.

This is done by creating a type library module like 'MyApp::Types' and then importing types from that module into other modules.

As a side effect, the declaration mechanism allows you to write type names as barewords (really function calls), which catches typos in names at compile time rather than run time.

This module also provides some helper functions for using Moose types outside of attribute declarations.

If you mix string-based names with types created by this module, it will warn, with a few exceptions. If you are declaring a 'class_type()' or 'role_type()' within your type library, or if you use a fully qualified name like '"MyApp::Foo"'.


License: Artistic-1.0 or GPL-1.0+
URL: http://search.cpan.org/dist/MooseX-Types/

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.50-bp156.3.1 info GA Release 2023-07-22 15 SP6
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-MooseX-Types
0.50-bp155.2.8 info GA Release 2023-05-17 15 SP5
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-MooseX-Types
0.50-bp154.1.16 info GA Release 2022-05-09 15 SP4
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-MooseX-Types
0.50-bp153.1.13 info GA Release 2021-03-06 15 SP3
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-MooseX-Types
0.50-bp152.3.14 info GA Release 2020-04-17 15 SP2
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-MooseX-Types
0.50-bp151.3.1 info GA Release 2019-07-16 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-MooseX-Types
0.50-bp151.2.11 info GA Release 2019-05-18 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-MooseX-Types
0.50-bp150.2.4 info GA Release 2018-07-30 15
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-MooseX-Types