| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package List::Objects::WithUtils::Array::Immutable::Typed; |
|
2
|
|
|
|
|
|
|
$List::Objects::WithUtils::Array::Immutable::Typed::VERSION = '2.027002'; |
|
3
|
98
|
|
|
98
|
|
2184
|
use strictures 2; |
|
|
98
|
|
|
|
|
612
|
|
|
|
98
|
|
|
|
|
4524
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
require Role::Tiny; |
|
6
|
|
|
|
|
|
|
Role::Tiny->apply_roles_to_package( __PACKAGE__, |
|
7
|
|
|
|
|
|
|
qw/ |
|
8
|
|
|
|
|
|
|
List::Objects::WithUtils::Role::Array |
|
9
|
|
|
|
|
|
|
List::Objects::WithUtils::Role::Array::WithJunctions |
|
10
|
|
|
|
|
|
|
List::Objects::WithUtils::Role::Array::Typed |
|
11
|
|
|
|
|
|
|
List::Objects::WithUtils::Role::Array::Immutable |
|
12
|
|
|
|
|
|
|
/, |
|
13
|
|
|
|
|
|
|
); |
|
14
|
|
|
|
|
|
|
|
|
15
|
98
|
|
|
98
|
|
23503
|
use Exporter (); |
|
|
98
|
|
|
|
|
229
|
|
|
|
98
|
|
|
|
|
5376
|
|
|
16
|
|
|
|
|
|
|
our @EXPORT = 'immarray_of'; |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub import { |
|
19
|
98
|
|
|
98
|
|
277
|
my $pkg = caller; |
|
20
|
98
|
|
|
98
|
|
1106
|
{ no strict 'refs'; |
|
|
98
|
|
|
|
|
195
|
|
|
|
98
|
|
|
|
|
15032
|
|
|
|
98
|
|
|
|
|
189
|
|
|
21
|
98
|
|
|
|
|
327
|
${"${pkg}::a"} = ${"${pkg}::a"}; |
|
|
98
|
|
|
|
|
276
|
|
|
|
98
|
|
|
|
|
392
|
|
|
22
|
98
|
|
|
|
|
256
|
${"${pkg}::b"} = ${"${pkg}::b"}; |
|
|
98
|
|
|
|
|
338
|
|
|
|
98
|
|
|
|
|
341
|
|
|
23
|
|
|
|
|
|
|
} |
|
24
|
98
|
|
|
|
|
7064
|
goto &Exporter::import |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
2
|
|
|
2
|
0
|
602
|
sub immarray_of { __PACKAGE__->new(@_) } |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=pod |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=for Pod::Coverage immarray_of |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 NAME |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
List::Objects::WithUtils::Array::Immutable::Typed - Immutable typed arrays |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
use List::Objects::WithUtils 'immarray_of'; |
|
42
|
|
|
|
|
|
|
use Types::Standard -types; |
|
43
|
|
|
|
|
|
|
my $array = immarray_of( Int() => 1, 2, 3 ); |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
These are immutable type-checking array objects, essentially a combination of |
|
48
|
|
|
|
|
|
|
L and |
|
49
|
|
|
|
|
|
|
L. |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Type-checking is performed when the object is created; attempts to modify the |
|
52
|
|
|
|
|
|
|
object will throw an exception. |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
This class consumes the following roles, which contain most of the relevant |
|
55
|
|
|
|
|
|
|
documentation: |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
L |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
L |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
L |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
L |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 AUTHOR |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Jon Portnoy |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=cut |