File Coverage

blib/lib/Data/Monad/Singleton.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 4 4 100.0
total 28 28 100.0


line stmt bran cond sub pod time code
1             package Data::Monad::Singleton;
2 1     1   658 use strict;
  1         2  
  1         33  
3 1     1   6 use warnings;
  1         3  
  1         26  
4 1     1   845 use parent qw/Data::Monad::Base::Monad/;
  1         312  
  1         5  
5 1     1   47 use Exporter qw/import/;
  1         6  
  1         123  
6              
7             our @EXPORT = qw/singleton/;
8              
9 19     19 1 12372 sub singleton { __PACKAGE__->new }
10              
11             my $instance = bless \(my $x = '*'), __PACKAGE__;
12 19     19 1 114 sub new { $instance }
13              
14 2     2 1 8 sub unit { singleton }
15              
16 8     8 1 14 sub flat_map { singleton }
17              
18             1;
19              
20             __END__