line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Monad::Identity; |
2
|
1
|
|
|
1
|
|
381
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
3
|
1
|
|
|
1
|
|
4
|
use base; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
427
|
use parent qw/Data::Monad::Base::Monad/; |
|
1
|
|
|
|
|
235
|
|
|
1
|
|
|
|
|
4
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
4
|
|
|
4
|
1
|
4
|
my $class = shift; |
8
|
4
|
|
|
|
|
37
|
bless [@_], $class; |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub unit { |
12
|
4
|
|
|
4
|
1
|
21
|
my $class = shift; |
13
|
4
|
|
|
|
|
10
|
$class->new(@_); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub flat_map { |
17
|
2
|
|
|
2
|
1
|
1
|
my ($m, $f) = @_; |
18
|
2
|
|
|
|
|
5
|
$f->($m->value); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
4
|
100
|
|
4
|
1
|
11
|
sub value { wantarray ? @{$_[0]} : $_[0][0] } |
|
3
|
|
|
|
|
17
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |