line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Method/Function Signatures w/Type::Tiny Constraints |
2
|
|
|
|
|
|
|
package Type::Tiny::Signatures; |
3
|
|
|
|
|
|
|
|
4
|
4
|
|
|
4
|
|
125733
|
use 5.14.0; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
173
|
|
5
|
4
|
|
|
4
|
|
18
|
use strict; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
127
|
|
6
|
4
|
|
|
4
|
|
16
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
1022
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Function::Parameters; |
9
|
|
|
|
|
|
|
require Type::Registry; |
10
|
|
|
|
|
|
|
require Type::Tiny; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $CALLER = caller; |
13
|
|
|
|
|
|
|
our @DEFAULTS = 'Types::Standard'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = '0.04'; # VERSION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
unshift @Function::Parameters::type_reifiers => sub { |
18
|
|
|
|
|
|
|
Type::Registry->for_class($CALLER)->lookup($_[0]); |
19
|
|
|
|
|
|
|
}; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub import { |
22
|
4
|
|
|
4
|
|
37
|
my (@CONFIG, @LIBRARIES); |
23
|
4
|
50
|
|
|
|
32
|
for (map 'ARRAY' eq ref $_ ? @$_ : $_, splice @_, 1) { |
24
|
4
|
100
|
50
|
|
|
39
|
push @LIBRARIES, $_ and next if !ref && !/^:/; |
|
|
|
33
|
|
|
|
|
25
|
2
|
|
|
|
|
4
|
push @CONFIG, $_; |
26
|
|
|
|
|
|
|
} |
27
|
4
|
|
|
|
|
25
|
Type::Registry->for_class($CALLER)->add_types($_) for @DEFAULTS, @LIBRARIES; |
28
|
4
|
|
|
|
|
181247
|
Function::Parameters->import(@CONFIG); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__END__ |