|
NAMEregistryABSTRACTRegister Type Libraries with NamespacesSYNOPSISpackage main; use strict; use warnings; use registry; $registry; # $registry->('main') # 'main' Type::Registry object # or ... # return registry object based on caller # registry::access('main') # and ... # resolve type expressions based on caller # registry::lookup('ClassName') DESCRIPTIONThis pragma is used to associate the calling package with Type::Tiny type libraries. A $registry variable is made available to the caller to be used to access registry objects. The variable is a callback (i.e. coderef) which should be called with a single argument, the namespace whose registry object you want, otherwise the argument defaults to "main".package main; use strict; use warnings; use registry 'Types::Standard'; use registry 'Types::Common::Numeric'; use registry 'Types::Common::String'; $registry; # resolve type expression using exported variable # my $constraint = $registry->('main')->lookup('StrLength[10]') # resolve type expression using registry function # my $constraint = registry::lookup('StrLength[10]', 'main') You can configure the calling package to be associated with multiple distinct type libraries. The exported $registry object can be used to reify type constraints and resolve type expressions. AUTHORAl Newkirk, "awncorp@cpan.org"LICENSECopyright (C) 2011-2019, Al Newkirk, et al.This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file" <https://github.com/iamalnewkirk/routines/blob/master/LICENSE>. PROJECTWiki <https://github.com/iamalnewkirk/routines/wiki>Project <https://github.com/iamalnewkirk/routines> Initiatives <https://github.com/iamalnewkirk/routines/projects> Milestones <https://github.com/iamalnewkirk/routines/milestones> Contributing <https://github.com/iamalnewkirk/routines/blob/master/CONTRIBUTE.md> Issues <https://github.com/iamalnewkirk/routines/issues>
Visit the GSP FreeBSD Man Page Interface. |