line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Focus::Applicative::Identity; |
2
|
19
|
|
|
19
|
|
15902
|
use strict; |
|
19
|
|
|
|
|
26
|
|
|
19
|
|
|
|
|
679
|
|
3
|
19
|
|
|
19
|
|
78
|
use warnings; |
|
19
|
|
|
|
|
20
|
|
|
19
|
|
|
|
|
530
|
|
4
|
19
|
|
|
19
|
|
446
|
use parent qw(Data::Focus::Applicative); |
|
19
|
|
|
|
|
257
|
|
|
19
|
|
|
|
|
125
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
29376
|
|
|
29376
|
1
|
32685
|
my ($class, $datum) = @_; |
8
|
29376
|
|
|
|
|
106098
|
return bless \$datum, $class; |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
*pure = *new; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub build { |
14
|
11017
|
|
|
11017
|
1
|
14831
|
my ($class, $builder, @f_parts) = @_; |
15
|
11017
|
|
|
|
|
13481
|
return $class->new($builder->(map { $_->run_identity } @f_parts)); |
|
17503
|
|
|
|
|
23381
|
|
16
|
|
|
|
|
|
|
## should we type-check @f_parts? |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub create_part_mapper { |
20
|
11860
|
|
|
11860
|
1
|
14411
|
my ($class, $updater) = @_; |
21
|
11860
|
|
|
17227
|
|
54178
|
return sub { $class->new($updater->(shift)) }; |
|
17227
|
|
|
|
|
29508
|
|
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub run_identity { |
25
|
29373
|
|
|
29373
|
1
|
21478
|
return ${$_[0]}; |
|
29373
|
|
|
|
|
64740
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
__END__ |