line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# This file was autogenerated. |
2
|
2
|
|
|
2
|
|
233578
|
use 5.008001; |
|
2
|
|
|
|
|
14
|
|
3
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
48
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
51
|
|
5
|
2
|
|
|
2
|
|
9
|
no warnings qw( void once ); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
103
|
|
6
|
2
|
|
|
2
|
|
419
|
use Hydrogen (); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
33
|
|
7
|
2
|
|
|
2
|
|
380
|
use Hydrogen::Bool (); |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
123
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Hydrogen::Curry::Bool; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
12
|
|
|
|
|
|
|
our $VERSION = '0.020000'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Hydrogen::Curry::Bool - easily curry functions from Hydrogen::Bool |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 VERSION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
This documentation is for Hydrogen::Curry::Bool 0.020000, |
21
|
|
|
|
|
|
|
which is based on Sub::HandlesVia::HandlerLibrary::Bool 0.046. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 FUNCTIONS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Each function expects a scalar which will be treated as a boolean as its only argument and returns a coderef. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
2
|
|
|
|
|
10
|
use Exporter::Shiny qw( |
32
|
|
|
|
|
|
|
curry_not |
33
|
|
|
|
|
|
|
curry_reset |
34
|
|
|
|
|
|
|
curry_set |
35
|
|
|
|
|
|
|
curry_toggle |
36
|
|
|
|
|
|
|
curry_unset |
37
|
2
|
|
|
2
|
|
18
|
); |
|
2
|
|
|
|
|
4
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 C<< curry_not( $bool ) >> |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Bool::not >>. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub curry_not { |
46
|
1
|
50
|
|
1
|
1
|
8024
|
@_ == 1 |
47
|
|
|
|
|
|
|
or Hydrogen::croak( |
48
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_not: got %d, %s", |
49
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
50
|
|
|
|
|
|
|
); |
51
|
1
|
|
|
|
|
2
|
(!!1) |
52
|
|
|
|
|
|
|
or Hydrogen::croak( |
53
|
|
|
|
|
|
|
"Type check failed in signature for curry_not: %s should be %s", |
54
|
|
|
|
|
|
|
"\\$_[0]", "Any" |
55
|
|
|
|
|
|
|
); |
56
|
1
|
|
|
|
|
3
|
my $ref = \$_[0]; |
57
|
1
|
|
|
0
|
|
19
|
return sub { Hydrogen::Bool::not( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 C<< curry_reset( $bool ) >> |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Bool::reset >>. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub curry_reset { |
67
|
1
|
50
|
|
1
|
1
|
4472
|
@_ == 1 |
68
|
|
|
|
|
|
|
or Hydrogen::croak( |
69
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_reset: got %d, %s", |
70
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
71
|
|
|
|
|
|
|
); |
72
|
1
|
|
|
|
|
3
|
(!!1) |
73
|
|
|
|
|
|
|
or Hydrogen::croak( |
74
|
|
|
|
|
|
|
"Type check failed in signature for curry_reset: %s should be %s", |
75
|
|
|
|
|
|
|
"\\$_[0]", "Any" |
76
|
|
|
|
|
|
|
); |
77
|
1
|
|
|
|
|
4
|
my $ref = \$_[0]; |
78
|
1
|
|
|
0
|
|
5
|
return sub { Hydrogen::Bool::reset( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 C<< curry_set( $bool ) >> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Bool::set >>. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=cut |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub curry_set { |
88
|
1
|
50
|
|
1
|
1
|
3534
|
@_ == 1 |
89
|
|
|
|
|
|
|
or Hydrogen::croak( |
90
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_set: got %d, %s", |
91
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
92
|
|
|
|
|
|
|
); |
93
|
1
|
|
|
|
|
3
|
(!!1) |
94
|
|
|
|
|
|
|
or Hydrogen::croak( |
95
|
|
|
|
|
|
|
"Type check failed in signature for curry_set: %s should be %s", |
96
|
|
|
|
|
|
|
"\\$_[0]", "Any" |
97
|
|
|
|
|
|
|
); |
98
|
1
|
|
|
|
|
4
|
my $ref = \$_[0]; |
99
|
1
|
|
|
0
|
|
6
|
return sub { Hydrogen::Bool::set( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head2 C<< curry_toggle( $bool ) >> |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Bool::toggle >>. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=cut |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub curry_toggle { |
109
|
1
|
50
|
|
1
|
1
|
3513
|
@_ == 1 |
110
|
|
|
|
|
|
|
or Hydrogen::croak( |
111
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_toggle: got %d, %s", |
112
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
113
|
|
|
|
|
|
|
); |
114
|
1
|
|
|
|
|
2
|
(!!1) |
115
|
|
|
|
|
|
|
or Hydrogen::croak( |
116
|
|
|
|
|
|
|
"Type check failed in signature for curry_toggle: %s should be %s", |
117
|
|
|
|
|
|
|
"\\$_[0]", "Any" |
118
|
|
|
|
|
|
|
); |
119
|
1
|
|
|
|
|
3
|
my $ref = \$_[0]; |
120
|
1
|
|
|
0
|
|
4
|
return sub { Hydrogen::Bool::toggle( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head2 C<< curry_unset( $bool ) >> |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Bool::unset >>. |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=cut |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
sub curry_unset { |
130
|
1
|
50
|
|
1
|
1
|
3480
|
@_ == 1 |
131
|
|
|
|
|
|
|
or Hydrogen::croak( |
132
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_unset: got %d, %s", |
133
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
134
|
|
|
|
|
|
|
); |
135
|
1
|
|
|
|
|
3
|
(!!1) |
136
|
|
|
|
|
|
|
or Hydrogen::croak( |
137
|
|
|
|
|
|
|
"Type check failed in signature for curry_unset: %s should be %s", |
138
|
|
|
|
|
|
|
"\\$_[0]", "Any" |
139
|
|
|
|
|
|
|
); |
140
|
1
|
|
|
|
|
2
|
my $ref = \$_[0]; |
141
|
1
|
|
|
0
|
|
7
|
return sub { Hydrogen::Bool::unset( $$ref, @_ ) }; |
|
0
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
1; |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head1 EXPORT |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
No functions are exported by this module by default. To import them all (this is usually a bad idea), use: |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
use Hydrogen::Curry::Bool -all; |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
To import a particular function, use: |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
use Hydrogen::Curry::Bool 'curry_set'; |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
To rename functions: |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
use Hydrogen::Curry::Bool 'curry_set' => { -as => 'myfunc' }; |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
On Perl 5.37.2+ (or if L is installed) you can import lexically: |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
use Hydrogen::Curry::Bool -lexical, 'curry_set'; |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
See L for more hints on importing. |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
=head1 BUGS |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
Please report any bugs to |
169
|
|
|
|
|
|
|
L. |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=head1 SEE ALSO |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
L, |
174
|
|
|
|
|
|
|
L, |
175
|
|
|
|
|
|
|
L, |
176
|
|
|
|
|
|
|
L. |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=head1 AUTHOR |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
Toby Inkster Etobyink@cpan.orgE. |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
This software is copyright (c) 2022-2023 by Toby Inkster. |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
187
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=head1 DISCLAIMER OF WARRANTIES |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
192
|
|
|
|
|
|
|
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
193
|
|
|
|
|
|
|
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
194
|
|
|
|
|
|
|
|