As many of you will know by now, Moose comes with its own type system that you can use, extend and introspect. Since the types are handled in a global registry, you have to be concerned about namespaces like with every other perl package.
I started writing MooseX-Types with the objective of writing a tool that provides a solution to the namespace problem by simply enclosing type definitions in a library and turn the types into exports.
Since then, the community has put a lot of thought and effort into the idea and made it into much more. There are reusable type libraries on CPAN for DateTime, Path-Class, data structures, input/output, URIs, and the common extensions of the core types. You can also for some time now refer to imported types in MooseX-Method-Signatures.
With the recent rise of Devel-Declare, we have a lot more options for defining our interfaces. There is already thought and work put into developing nicer sugar for declaring type libraries, so I focused on sugar for importing the types that models nicely onto MooseX-Declare. This article is a summary if what I’ve come up with so far.



