line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# This file was autogenerated. |
2
|
2
|
|
|
2
|
|
229373
|
use 5.008001; |
|
2
|
|
|
|
|
13
|
|
3
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
37
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
53
|
|
5
|
2
|
|
|
2
|
|
12
|
no warnings qw( void once ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
54
|
|
6
|
2
|
|
|
2
|
|
402
|
use Hydrogen (); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
66
|
|
7
|
2
|
|
|
2
|
|
495
|
use Hydrogen::Number (); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
147
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Hydrogen::Curry::Number; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
12
|
|
|
|
|
|
|
our $VERSION = '0.018'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Hydrogen::Curry::Number - easily curry functions from Hydrogen::Number |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 VERSION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
This documentation is for Hydrogen::Curry::Number 0.018, |
21
|
|
|
|
|
|
|
which is based on Sub::HandlesVia::HandlerLibrary::Number 0.046. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 FUNCTIONS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Each function expects a numeric scalar as its only argument and returns a coderef. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
2
|
|
|
|
|
13
|
use Exporter::Shiny qw( |
32
|
|
|
|
|
|
|
curry_abs |
33
|
|
|
|
|
|
|
curry_add |
34
|
|
|
|
|
|
|
curry_cmp |
35
|
|
|
|
|
|
|
curry_div |
36
|
|
|
|
|
|
|
curry_eq |
37
|
|
|
|
|
|
|
curry_ge |
38
|
|
|
|
|
|
|
curry_get |
39
|
|
|
|
|
|
|
curry_gt |
40
|
|
|
|
|
|
|
curry_le |
41
|
|
|
|
|
|
|
curry_lt |
42
|
|
|
|
|
|
|
curry_mod |
43
|
|
|
|
|
|
|
curry_mul |
44
|
|
|
|
|
|
|
curry_ne |
45
|
|
|
|
|
|
|
curry_set |
46
|
|
|
|
|
|
|
curry_sub |
47
|
2
|
|
|
2
|
|
13
|
); |
|
2
|
|
|
|
|
7
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 C<< curry_abs( $number ) >> |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Number::abs >>. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub curry_abs { |
56
|
1
|
50
|
|
1
|
1
|
7231
|
@_ == 1 |
57
|
|
|
|
|
|
|
or Hydrogen::croak( |
58
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_abs: got %d, %s", |
59
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
60
|
|
|
|
|
|
|
); |
61
|
2
|
50
|
33
|
2
|
|
198
|
(do { package Hydrogen::Number::__SANDBOX__; use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
2
|
50
|
|
|
|
4
|
|
|
2
|
|
|
|
|
284
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
15
|
|
62
|
|
|
|
|
|
|
or Hydrogen::croak( |
63
|
|
|
|
|
|
|
"Type check failed in signature for curry_abs: %s should be %s", |
64
|
|
|
|
|
|
|
"\\$_[0]", "Num" |
65
|
|
|
|
|
|
|
); |
66
|
1
|
|
|
|
|
3
|
my $ref = \$_[0]; |
67
|
1
|
|
|
0
|
|
6
|
return sub { Hydrogen::Number::abs( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 C<< curry_add( $number ) >> |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Number::add >>. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub curry_add { |
77
|
1
|
50
|
|
1
|
1
|
3510
|
@_ == 1 |
78
|
|
|
|
|
|
|
or Hydrogen::croak( |
79
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_add: got %d, %s", |
80
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
81
|
|
|
|
|
|
|
); |
82
|
2
|
50
|
33
|
2
|
|
14
|
(do { package Hydrogen::Number::__SANDBOX__; use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
2
|
50
|
|
|
|
11
|
|
|
2
|
|
|
|
|
324
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
12
|
|
83
|
|
|
|
|
|
|
or Hydrogen::croak( |
84
|
|
|
|
|
|
|
"Type check failed in signature for curry_add: %s should be %s", |
85
|
|
|
|
|
|
|
"\\$_[0]", "Num" |
86
|
|
|
|
|
|
|
); |
87
|
1
|
|
|
|
|
3
|
my $ref = \$_[0]; |
88
|
1
|
|
|
0
|
|
6
|
return sub { Hydrogen::Number::add( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head2 C<< curry_cmp( $number ) >> |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Number::cmp >>. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=cut |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
sub curry_cmp { |
98
|
1
|
50
|
|
1
|
1
|
2846
|
@_ == 1 |
99
|
|
|
|
|
|
|
or Hydrogen::croak( |
100
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_cmp: got %d, %s", |
101
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
102
|
|
|
|
|
|
|
); |
103
|
2
|
50
|
33
|
2
|
|
14
|
(do { package Hydrogen::Number::__SANDBOX__; use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
2
|
50
|
|
|
|
10
|
|
|
2
|
|
|
|
|
290
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
21
|
|
104
|
|
|
|
|
|
|
or Hydrogen::croak( |
105
|
|
|
|
|
|
|
"Type check failed in signature for curry_cmp: %s should be %s", |
106
|
|
|
|
|
|
|
"\\$_[0]", "Num" |
107
|
|
|
|
|
|
|
); |
108
|
1
|
|
|
|
|
3
|
my $ref = \$_[0]; |
109
|
1
|
|
|
0
|
|
7
|
return sub { Hydrogen::Number::cmp( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head2 C<< curry_div( $number ) >> |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Number::div >>. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=cut |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
sub curry_div { |
119
|
1
|
50
|
|
1
|
1
|
2733
|
@_ == 1 |
120
|
|
|
|
|
|
|
or Hydrogen::croak( |
121
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_div: got %d, %s", |
122
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
123
|
|
|
|
|
|
|
); |
124
|
2
|
50
|
33
|
2
|
|
14
|
(do { package Hydrogen::Number::__SANDBOX__; use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
2
|
50
|
|
|
|
10
|
|
|
2
|
|
|
|
|
337
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
12
|
|
125
|
|
|
|
|
|
|
or Hydrogen::croak( |
126
|
|
|
|
|
|
|
"Type check failed in signature for curry_div: %s should be %s", |
127
|
|
|
|
|
|
|
"\\$_[0]", "Num" |
128
|
|
|
|
|
|
|
); |
129
|
1
|
|
|
|
|
3
|
my $ref = \$_[0]; |
130
|
1
|
|
|
0
|
|
5
|
return sub { Hydrogen::Number::div( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=head2 C<< curry_eq( $number ) >> |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Number::eq >>. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=cut |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub curry_eq { |
140
|
1
|
50
|
|
1
|
1
|
2872
|
@_ == 1 |
141
|
|
|
|
|
|
|
or Hydrogen::croak( |
142
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_eq: got %d, %s", |
143
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
144
|
|
|
|
|
|
|
); |
145
|
2
|
50
|
33
|
2
|
|
15
|
(do { package Hydrogen::Number::__SANDBOX__; use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
2
|
50
|
|
|
|
9
|
|
|
2
|
|
|
|
|
298
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
22
|
|
146
|
|
|
|
|
|
|
or Hydrogen::croak( |
147
|
|
|
|
|
|
|
"Type check failed in signature for curry_eq: %s should be %s", |
148
|
|
|
|
|
|
|
"\\$_[0]", "Num" |
149
|
|
|
|
|
|
|
); |
150
|
1
|
|
|
|
|
9
|
my $ref = \$_[0]; |
151
|
1
|
|
|
0
|
|
11
|
return sub { Hydrogen::Number::eq( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head2 C<< curry_ge( $number ) >> |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Number::ge >>. |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=cut |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
sub curry_ge { |
161
|
1
|
50
|
|
1
|
1
|
2806
|
@_ == 1 |
162
|
|
|
|
|
|
|
or Hydrogen::croak( |
163
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_ge: got %d, %s", |
164
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
165
|
|
|
|
|
|
|
); |
166
|
2
|
50
|
33
|
2
|
|
13
|
(do { package Hydrogen::Number::__SANDBOX__; use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
2
|
50
|
|
|
|
4
|
|
|
2
|
|
|
|
|
310
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
13
|
|
167
|
|
|
|
|
|
|
or Hydrogen::croak( |
168
|
|
|
|
|
|
|
"Type check failed in signature for curry_ge: %s should be %s", |
169
|
|
|
|
|
|
|
"\\$_[0]", "Num" |
170
|
|
|
|
|
|
|
); |
171
|
1
|
|
|
|
|
3
|
my $ref = \$_[0]; |
172
|
1
|
|
|
0
|
|
5
|
return sub { Hydrogen::Number::ge( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=head2 C<< curry_get( $number ) >> |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Number::get >>. |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=cut |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
sub curry_get { |
182
|
1
|
50
|
|
1
|
1
|
2814
|
@_ == 1 |
183
|
|
|
|
|
|
|
or Hydrogen::croak( |
184
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_get: got %d, %s", |
185
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
186
|
|
|
|
|
|
|
); |
187
|
2
|
50
|
33
|
2
|
|
15
|
(do { package Hydrogen::Number::__SANDBOX__; use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
2
|
50
|
|
|
|
3
|
|
|
2
|
|
|
|
|
296
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
13
|
|
188
|
|
|
|
|
|
|
or Hydrogen::croak( |
189
|
|
|
|
|
|
|
"Type check failed in signature for curry_get: %s should be %s", |
190
|
|
|
|
|
|
|
"\\$_[0]", "Num" |
191
|
|
|
|
|
|
|
); |
192
|
1
|
|
|
|
|
3
|
my $ref = \$_[0]; |
193
|
1
|
|
|
0
|
|
4
|
return sub { Hydrogen::Number::get( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=head2 C<< curry_gt( $number ) >> |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Number::gt >>. |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
=cut |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
sub curry_gt { |
203
|
1
|
50
|
|
1
|
1
|
2747
|
@_ == 1 |
204
|
|
|
|
|
|
|
or Hydrogen::croak( |
205
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_gt: got %d, %s", |
206
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
207
|
|
|
|
|
|
|
); |
208
|
2
|
50
|
33
|
2
|
|
13
|
(do { package Hydrogen::Number::__SANDBOX__; use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
2
|
50
|
|
|
|
4
|
|
|
2
|
|
|
|
|
334
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
15
|
|
209
|
|
|
|
|
|
|
or Hydrogen::croak( |
210
|
|
|
|
|
|
|
"Type check failed in signature for curry_gt: %s should be %s", |
211
|
|
|
|
|
|
|
"\\$_[0]", "Num" |
212
|
|
|
|
|
|
|
); |
213
|
1
|
|
|
|
|
4
|
my $ref = \$_[0]; |
214
|
1
|
|
|
0
|
|
5
|
return sub { Hydrogen::Number::gt( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
215
|
|
|
|
|
|
|
} |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
=head2 C<< curry_le( $number ) >> |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Number::le >>. |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
=cut |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
sub curry_le { |
224
|
1
|
50
|
|
1
|
1
|
2804
|
@_ == 1 |
225
|
|
|
|
|
|
|
or Hydrogen::croak( |
226
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_le: got %d, %s", |
227
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
228
|
|
|
|
|
|
|
); |
229
|
2
|
50
|
33
|
2
|
|
21
|
(do { package Hydrogen::Number::__SANDBOX__; use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
2
|
50
|
|
|
|
11
|
|
|
2
|
|
|
|
|
311
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
13
|
|
230
|
|
|
|
|
|
|
or Hydrogen::croak( |
231
|
|
|
|
|
|
|
"Type check failed in signature for curry_le: %s should be %s", |
232
|
|
|
|
|
|
|
"\\$_[0]", "Num" |
233
|
|
|
|
|
|
|
); |
234
|
1
|
|
|
|
|
5
|
my $ref = \$_[0]; |
235
|
1
|
|
|
0
|
|
5
|
return sub { Hydrogen::Number::le( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
236
|
|
|
|
|
|
|
} |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
=head2 C<< curry_lt( $number ) >> |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Number::lt >>. |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
=cut |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
sub curry_lt { |
245
|
1
|
50
|
|
1
|
1
|
2802
|
@_ == 1 |
246
|
|
|
|
|
|
|
or Hydrogen::croak( |
247
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_lt: got %d, %s", |
248
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
249
|
|
|
|
|
|
|
); |
250
|
2
|
50
|
33
|
2
|
|
35
|
(do { package Hydrogen::Number::__SANDBOX__; use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
2
|
50
|
|
|
|
5
|
|
|
2
|
|
|
|
|
306
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
251
|
|
|
|
|
|
|
or Hydrogen::croak( |
252
|
|
|
|
|
|
|
"Type check failed in signature for curry_lt: %s should be %s", |
253
|
|
|
|
|
|
|
"\\$_[0]", "Num" |
254
|
|
|
|
|
|
|
); |
255
|
1
|
|
|
|
|
4
|
my $ref = \$_[0]; |
256
|
1
|
|
|
0
|
|
5
|
return sub { Hydrogen::Number::lt( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
257
|
|
|
|
|
|
|
} |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
=head2 C<< curry_mod( $number ) >> |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Number::mod >>. |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
=cut |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
sub curry_mod { |
266
|
1
|
50
|
|
1
|
1
|
2750
|
@_ == 1 |
267
|
|
|
|
|
|
|
or Hydrogen::croak( |
268
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_mod: got %d, %s", |
269
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
270
|
|
|
|
|
|
|
); |
271
|
2
|
50
|
33
|
2
|
|
16
|
(do { package Hydrogen::Number::__SANDBOX__; use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
2
|
50
|
|
|
|
7
|
|
|
2
|
|
|
|
|
322
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
13
|
|
272
|
|
|
|
|
|
|
or Hydrogen::croak( |
273
|
|
|
|
|
|
|
"Type check failed in signature for curry_mod: %s should be %s", |
274
|
|
|
|
|
|
|
"\\$_[0]", "Num" |
275
|
|
|
|
|
|
|
); |
276
|
1
|
|
|
|
|
4
|
my $ref = \$_[0]; |
277
|
1
|
|
|
0
|
|
4
|
return sub { Hydrogen::Number::mod( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
278
|
|
|
|
|
|
|
} |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
=head2 C<< curry_mul( $number ) >> |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Number::mul >>. |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
=cut |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
sub curry_mul { |
287
|
1
|
50
|
|
1
|
1
|
2841
|
@_ == 1 |
288
|
|
|
|
|
|
|
or Hydrogen::croak( |
289
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_mul: got %d, %s", |
290
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
291
|
|
|
|
|
|
|
); |
292
|
2
|
50
|
33
|
2
|
|
14
|
(do { package Hydrogen::Number::__SANDBOX__; use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
2
|
50
|
|
|
|
4
|
|
|
2
|
|
|
|
|
291
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
293
|
|
|
|
|
|
|
or Hydrogen::croak( |
294
|
|
|
|
|
|
|
"Type check failed in signature for curry_mul: %s should be %s", |
295
|
|
|
|
|
|
|
"\\$_[0]", "Num" |
296
|
|
|
|
|
|
|
); |
297
|
1
|
|
|
|
|
3
|
my $ref = \$_[0]; |
298
|
1
|
|
|
0
|
|
5
|
return sub { Hydrogen::Number::mul( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
299
|
|
|
|
|
|
|
} |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
=head2 C<< curry_ne( $number ) >> |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Number::ne >>. |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
=cut |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
sub curry_ne { |
308
|
1
|
50
|
|
1
|
1
|
2802
|
@_ == 1 |
309
|
|
|
|
|
|
|
or Hydrogen::croak( |
310
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_ne: got %d, %s", |
311
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
312
|
|
|
|
|
|
|
); |
313
|
2
|
50
|
33
|
2
|
|
13
|
(do { package Hydrogen::Number::__SANDBOX__; use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
2
|
50
|
|
|
|
4
|
|
|
2
|
|
|
|
|
300
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
23
|
|
314
|
|
|
|
|
|
|
or Hydrogen::croak( |
315
|
|
|
|
|
|
|
"Type check failed in signature for curry_ne: %s should be %s", |
316
|
|
|
|
|
|
|
"\\$_[0]", "Num" |
317
|
|
|
|
|
|
|
); |
318
|
1
|
|
|
|
|
3
|
my $ref = \$_[0]; |
319
|
1
|
|
|
0
|
|
6
|
return sub { Hydrogen::Number::ne( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
320
|
|
|
|
|
|
|
} |
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
=head2 C<< curry_set( $number ) >> |
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Number::set >>. |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
=cut |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
sub curry_set { |
329
|
1
|
50
|
|
1
|
1
|
2786
|
@_ == 1 |
330
|
|
|
|
|
|
|
or Hydrogen::croak( |
331
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_set: got %d, %s", |
332
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
333
|
|
|
|
|
|
|
); |
334
|
2
|
50
|
33
|
2
|
|
12
|
(do { package Hydrogen::Number::__SANDBOX__; use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
2
|
50
|
|
|
|
5
|
|
|
2
|
|
|
|
|
271
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
21
|
|
335
|
|
|
|
|
|
|
or Hydrogen::croak( |
336
|
|
|
|
|
|
|
"Type check failed in signature for curry_set: %s should be %s", |
337
|
|
|
|
|
|
|
"\\$_[0]", "Num" |
338
|
|
|
|
|
|
|
); |
339
|
1
|
|
|
|
|
3
|
my $ref = \$_[0]; |
340
|
1
|
|
|
0
|
|
6
|
return sub { Hydrogen::Number::set( $$ref, @_ ) }; |
|
0
|
|
|
|
|
0
|
|
341
|
|
|
|
|
|
|
} |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
=head2 C<< curry_sub( $number ) >> |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
Curry the first argument of C<< Hydrogen::Number::sub >>. |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
=cut |
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
sub curry_sub { |
350
|
1
|
50
|
|
1
|
1
|
2759
|
@_ == 1 |
351
|
|
|
|
|
|
|
or Hydrogen::croak( |
352
|
|
|
|
|
|
|
"Wrong number of parameters in signature for curry_sub: got %d, %s", |
353
|
|
|
|
|
|
|
scalar(@_), "expected exactly 1 parameter" |
354
|
|
|
|
|
|
|
); |
355
|
2
|
50
|
33
|
2
|
|
14
|
(do { package Hydrogen::Number::__SANDBOX__; use Scalar::Util (); defined($_[0]) && !ref($_[0]) && Scalar::Util::looks_like_number($_[0]) }) |
|
2
|
50
|
|
|
|
4
|
|
|
2
|
|
|
|
|
252
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
12
|
|
356
|
|
|
|
|
|
|
or Hydrogen::croak( |
357
|
|
|
|
|
|
|
"Type check failed in signature for curry_sub: %s should be %s", |
358
|
|
|
|
|
|
|
"\\$_[0]", "Num" |
359
|
|
|
|
|
|
|
); |
360
|
1
|
|
|
|
|
4
|
my $ref = \$_[0]; |
361
|
1
|
|
|
0
|
|
5
|
return sub { Hydrogen::Number::sub( $$ref, @_ ) }; |
|
0
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
} |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
1; |
365
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
=head1 EXPORT |
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
No functions are exported by this module by default. To import them all (this is usually a bad idea), use: |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
use Hydrogen::Curry::Number -all; |
371
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
To import a particular function, use: |
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
use Hydrogen::Curry::Number 'curry_cmp'; |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
To rename functions: |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
use Hydrogen::Curry::Number 'curry_cmp' => { -as => 'myfunc' }; |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
On Perl 5.37.2+, you can import lexically: |
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
use Hydrogen::Curry::Number -lexical, 'curry_cmp'; |
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
See L for more hints on importing. |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
=head1 BUGS |
387
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
Please report any bugs to |
389
|
|
|
|
|
|
|
L. |
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
=head1 SEE ALSO |
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
L, |
394
|
|
|
|
|
|
|
L, |
395
|
|
|
|
|
|
|
L, |
396
|
|
|
|
|
|
|
L. |
397
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
=head1 AUTHOR |
399
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
Toby Inkster Etobyink@cpan.orgE. |
401
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE |
403
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
This software is copyright (c) 2022 by Toby Inkster. |
405
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
407
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
=head1 DISCLAIMER OF WARRANTIES |
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
412
|
|
|
|
|
|
|
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
413
|
|
|
|
|
|
|
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
414
|
|
|
|
|
|
|
|