• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

lib/Type/Tiny/H03-May-2022-13660

t/H28-Dec-2018-13287

CHANGESH A D28-Dec-20181,012 4536

INSTALLH A D28-Dec-20182.3 KiB7346

LICENSEH A D28-Dec-201817.9 KiB380292

MANIFESTH A D28-Dec-2018279 1918

META.jsonH A D28-Dec-20181.5 KiB5553

META.ymlH A D28-Dec-2018890 3029

Makefile.PLH A D28-Dec-20181.2 KiB5039

READMEH A D28-Dec-20181.2 KiB3324

README.mkdnH A D28-Dec-20181.7 KiB5033

cpanfileH A D28-Dec-2018326 1411

testH A D28-Dec-2018210 2817

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