Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
lib/Type/Tiny/ | H | 03-May-2022 | - | 136 | 60 | |
t/ | H | 28-Dec-2018 | - | 132 | 87 | |
CHANGES | H A D | 28-Dec-2018 | 1,012 | 45 | 36 | |
INSTALL | H A D | 28-Dec-2018 | 2.3 KiB | 73 | 46 | |
LICENSE | H A D | 28-Dec-2018 | 17.9 KiB | 380 | 292 | |
MANIFEST | H A D | 28-Dec-2018 | 279 | 19 | 18 | |
META.json | H A D | 28-Dec-2018 | 1.5 KiB | 55 | 53 | |
META.yml | H A D | 28-Dec-2018 | 890 | 30 | 29 | |
Makefile.PL | H A D | 28-Dec-2018 | 1.2 KiB | 50 | 39 | |
README | H A D | 28-Dec-2018 | 1.2 KiB | 33 | 24 | |
README.mkdn | H A D | 28-Dec-2018 | 1.7 KiB | 50 | 33 | |
cpanfile | H A D | 28-Dec-2018 | 326 | 14 | 11 | |
test | H A D | 28-Dec-2018 | 210 | 28 | 17 |
README
1SYNOPSIS 2 3 use Type::Tiny; 4 use Type::Tiny::Signatures; 5 6 method hello (Str $greeting, Str $fullname) { 7 print "$greeting, $fullname\n"; 8 } 9 10DESCRIPTION 11 12 This module uses Function::Parameters to extend Perl with keywords that 13 let you define methods and functions with parameter lists which can be 14 validated using Type::Tiny type constraints. The type constraints can 15 be provided by the Type::Tiny standard library, Types::Standard, or any 16 supported user-defined type library which can be a Moose, MooseX::Type, 17 MouseX::Type, or Type::Library library. 18 19 use Type::Tiny; 20 use Type::Tiny::Signatures 'MyApp::Types'; 21 22 method identify (Str $name, SSN $number) { 23 print "identifying $name using SSN $number\n"; 24 } 25 26 The method and function signatures can be configured to validate 27 user-defined type constraints by passing the user-defined type library 28 package name as an argument to the Type::Tiny::Signatures usage 29 declaration. The default behavior configures the Function::Parameters 30 pragma using options that mimick the previously default lax-mode, i.e. 31 strict-mode disabled. 32 33
README.mkdn
1# NAME 2 3Type::Tiny::Signatures - Type::Tiny Method/Function Signatures 4 5# VERSION 6 7version 0.08 8 9# SYNOPSIS 10 11 use Type::Tiny; 12 use Type::Tiny::Signatures; 13 14 method hello (Str $greeting, Str $fullname) { 15 print "$greeting, $fullname\n"; 16 } 17 18# DESCRIPTION 19 20This module uses [Function::Parameters](https://metacpan.org/pod/Function::Parameters) to extend Perl with keywords that 21let you define methods and functions with parameter lists which can be validated 22using [Type::Tiny](https://metacpan.org/pod/Type::Tiny) type constraints. The type constraints can be provided by 23the Type::Tiny standard library, [Types::Standard](https://metacpan.org/pod/Types::Standard), or any supported 24user-defined type library which can be a [Moose](https://metacpan.org/pod/Moose), [MooseX::Type](https://metacpan.org/pod/MooseX::Type), 25[MouseX::Type](https://metacpan.org/pod/MouseX::Type), or [Type::Library](https://metacpan.org/pod/Type::Library) library. 26 27 use Type::Tiny; 28 use Type::Tiny::Signatures 'MyApp::Types'; 29 30 method identify (Str $name, SSN $number) { 31 print "identifying $name using SSN $number\n"; 32 } 33 34The method and function signatures can be configured to validate user-defined 35type constraints by passing the user-defined type library package name as an 36argument to the Type::Tiny::Signatures usage declaration. The default behavior 37configures the Function::Parameters pragma using options that mimick the 38previously default lax-mode, i.e. strict-mode disabled. 39 40# AUTHOR 41 42Al Newkirk <al@iamalnewkirk.com> 43 44# COPYRIGHT AND LICENSE 45 46This software is copyright (c) 2018 by Al Newkirk. 47 48This is free software; you can redistribute it and/or modify it under 49the same terms as the Perl 5 programming language system itself. 50