mangrove 0.15.1 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/README.md +13 -10
- data/docs/Mangrove/ControlFlow/ControlSignal.html +1 -1
- data/docs/Mangrove/ControlFlow.html +1 -1
- data/docs/Mangrove/Option/ControlSignal.html +1 -1
- data/docs/Mangrove/Option/None.html +5 -5
- data/docs/Mangrove/Option/Some.html +3 -3
- data/docs/Mangrove/Option.html +1 -1
- data/docs/Mangrove/Result/ControlSignal.html +1 -1
- data/docs/Mangrove/Result/Err.html +94 -92
- data/docs/Mangrove/Result/Ok.html +94 -92
- data/docs/Mangrove/Result.html +202 -24
- data/docs/Mangrove.html +2 -2
- data/docs/_index.html +1 -1
- data/docs/file.README.html +14 -11
- data/docs/index.html +14 -11
- data/docs/method_list.html +151 -135
- data/docs/top-level-namespace.html +1 -1
- data/lib/mangrove/option.rb +4 -4
- data/lib/mangrove/result.rb +29 -17
- data/lib/mangrove/version.rb +1 -1
- metadata +3 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1490c99f990c5a7d85a86e0173ac4915d434638e4f43f469f86ede38f3de1549
|
4
|
+
data.tar.gz: b70e76b27a57358f5166c089c9135ddf4886fa87109996be9c824e6f14c5576f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f282f578b4b613a5e51a39d6c97796948c562c8d63e4580604d233cda286d47a61b89e88d070c6f8d45f8d3ab0e397902c3d5a029820b059a104b106db0767d0
|
7
|
+
data.tar.gz: 12792942541b08bcded968daf64c7b78db2909ad74e1792a0e9db5e38ec0c9f6e73a66bda3a94cba6eccfacc603aba39dfbb86be993b3f60d5a1380f836bd6a2
|
data/.rubocop.yml
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
AllCops:
|
4
4
|
TargetRubyVersion: 3.1
|
5
|
+
NewCops: enable
|
5
6
|
|
6
7
|
Layout/FirstArrayElementIndentation:
|
7
8
|
EnforcedStyle: consistent
|
@@ -27,6 +28,9 @@ Metrics/MethodLength:
|
|
27
28
|
Metrics/ModuleLength:
|
28
29
|
Enabled: false
|
29
30
|
|
31
|
+
Naming/BlockForwarding:
|
32
|
+
EnforcedStyle: explicit
|
33
|
+
|
30
34
|
Naming/VariableNumber:
|
31
35
|
EnforcedStyle: snake_case
|
32
36
|
|
data/README.md
CHANGED
@@ -69,10 +69,10 @@ class MyService
|
|
69
69
|
input
|
70
70
|
.safe_to_i
|
71
71
|
.map_err_wt(MyServiceError::Other) { |e|
|
72
|
-
MyServiceError::Other.new(MyAppError::Other.new(e))
|
72
|
+
MyServiceError::Other.new(MyAppError::Other.new(e)).as_my_service_error
|
73
73
|
}.and_then_wt(String) { |num|
|
74
74
|
if num < 1
|
75
|
-
Mangrove::Result.err(String, MyServiceError::E1.new(MyAppError::E1.new("num < 1")))
|
75
|
+
Mangrove::Result.err(String, MyServiceError::E1.new(MyAppError::E1.new("num < 1")).as_my_service_error)
|
76
76
|
elsif num < 3
|
77
77
|
Mangrove::Result
|
78
78
|
.ok(num, String)
|
@@ -84,7 +84,7 @@ class MyService
|
|
84
84
|
end
|
85
85
|
}
|
86
86
|
.map_err_wt(MyServiceError::E1) { |e|
|
87
|
-
MyServiceError::E1.new(MyAppError::E1.new("mapping to E1 #{e}"))
|
87
|
+
MyServiceError::E1.new(MyAppError::E1.new("mapping to E1 #{e}")).as_my_service_error
|
88
88
|
}
|
89
89
|
.map_ok { |str|
|
90
90
|
{
|
@@ -93,11 +93,17 @@ class MyService
|
|
93
93
|
}
|
94
94
|
.map_ok(&:to_s)
|
95
95
|
else
|
96
|
-
Mangrove::Result.err(String, MyServiceError::E2.new(MyAppError::E2.new))
|
96
|
+
Mangrove::Result.err(String, MyServiceError::E2.new(MyAppError::E2.new).as_my_service_error)
|
97
97
|
end
|
98
98
|
}
|
99
99
|
end
|
100
100
|
end
|
101
|
+
|
102
|
+
expect(MyController.new.create("0")).to eq "e1: num < 1"
|
103
|
+
expect(MyController.new.create("1")).to eq "{:my_key=>\"`1` < 2\"}"
|
104
|
+
expect(MyController.new.create("2")).to eq "e1: mapping to E1 not `2` < 2"
|
105
|
+
expect(MyController.new.create("3")).to eq "e2: e2"
|
106
|
+
expect(MyController.new.create("invalid")).to eq "other: invalid value for Integer(): \"invalid\""
|
101
107
|
```
|
102
108
|
|
103
109
|
Other examples are available at [`spec/**/**_spec.rb`](https://github.com/kazzix14/mangrove/tree/main/spec).
|
@@ -134,18 +140,15 @@ my_ok = Result::Ok.new("my value")
|
|
134
140
|
my_err = Result::Err.new("my err")
|
135
141
|
my_some = Option::Some.new(1234)
|
136
142
|
my_none = Option::None.new
|
137
|
-
|
138
|
-
# Including this Module into your class appends rescue clause into its methods. Results to `Option#unwrap!` and `Result#unwrap!` propagates to calling method like Ruet's `?` operator.
|
139
|
-
# https://doc.rust-lang.org/reference/expressions/operator-expr.html#the-question-mark-operator
|
140
|
-
include Mangrove::ControlFlow::Handler
|
141
143
|
```
|
142
144
|
|
143
145
|
## Commands for Development
|
144
146
|
```
|
145
147
|
git config core.hooksPath hooks
|
148
|
+
bundle install
|
146
149
|
bundle exec tapioca init
|
147
|
-
bundle exec tapioca gems
|
148
|
-
bundle exec tapioca dsl
|
150
|
+
bundle exec tapioca gems -w `nproc`
|
151
|
+
bundle exec tapioca dsl -w `nproc`
|
149
152
|
bundle exec tapioca check-shims
|
150
153
|
bundle exec tapioca init
|
151
154
|
bundle exec rspec -f d
|
@@ -213,7 +213,7 @@
|
|
213
213
|
</div>
|
214
214
|
|
215
215
|
<div id="footer">
|
216
|
-
Generated on
|
216
|
+
Generated on Wed Nov 8 16:39:46 2023 by
|
217
217
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
218
218
|
0.9.34 (ruby-3.2.2).
|
219
219
|
</div>
|
@@ -105,7 +105,7 @@
|
|
105
105
|
</div>
|
106
106
|
|
107
107
|
<div id="footer">
|
108
|
-
Generated on
|
108
|
+
Generated on Wed Nov 8 16:39:46 2023 by
|
109
109
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
110
110
|
0.9.34 (ruby-3.2.2).
|
111
111
|
</div>
|
@@ -424,7 +424,7 @@
|
|
424
424
|
</div>
|
425
425
|
|
426
426
|
<div id="footer">
|
427
|
-
Generated on
|
427
|
+
Generated on Wed Nov 8 16:39:48 2023 by
|
428
428
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
429
429
|
0.9.34 (ruby-3.2.2).
|
430
430
|
</div>
|
@@ -471,10 +471,10 @@
|
|
471
471
|
<span class='kw'>false</span>
|
472
472
|
<span class='kw'>when</span> <span class='const'><span class='object_link'><a href="../Option.html" title="Mangrove::Option (module)">Option</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Mangrove::Option::None (class)">None</a></span></span>
|
473
473
|
<span class='kw'>true</span>
|
474
|
-
<span class='kw'>else</span>
|
475
|
-
<span class='
|
476
|
-
<span class='
|
477
|
-
|
474
|
+
<span class='kw'>else</span> <span class='comment'># rubocop:disable Lint/DuplicateBranch
|
475
|
+
</span> <span class='comment'># Because == is defined on BasicObject, we can't be sure that `other` is an Option
|
476
|
+
</span> <span class='kw'>false</span>
|
477
|
+
<span class='kw'>end</span>
|
478
478
|
<span class='kw'>end</span></pre>
|
479
479
|
</td>
|
480
480
|
</tr>
|
@@ -1075,7 +1075,7 @@
|
|
1075
1075
|
</div>
|
1076
1076
|
|
1077
1077
|
<div id="footer">
|
1078
|
-
Generated on
|
1078
|
+
Generated on Wed Nov 8 16:39:47 2023 by
|
1079
1079
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1080
1080
|
0.9.34 (ruby-3.2.2).
|
1081
1081
|
</div>
|
@@ -575,8 +575,8 @@
|
|
575
575
|
<span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_instance_variable_get'>instance_variable_get</span><span class='lparen'>(</span><span class='symbol'>:@inner</span><span class='rparen'>)</span> <span class='op'>==</span> <span class='ivar'>@inner</span>
|
576
576
|
<span class='kw'>when</span> <span class='const'><span class='object_link'><a href="../Option.html" title="Mangrove::Option (module)">Option</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="None.html" title="Mangrove::Option::None (class)">None</a></span></span>
|
577
577
|
<span class='kw'>false</span>
|
578
|
-
<span class='kw'>else</span>
|
579
|
-
<span class='comment'>#
|
578
|
+
<span class='kw'>else</span> <span class='comment'># rubocop:disable Lint/DuplicateBranch
|
579
|
+
</span> <span class='comment'># Because == is defined on BasicObject, we can't be sure that `other` is an Option
|
580
580
|
</span> <span class='kw'>false</span>
|
581
581
|
<span class='kw'>end</span>
|
582
582
|
<span class='kw'>end</span></pre>
|
@@ -1192,7 +1192,7 @@
|
|
1192
1192
|
</div>
|
1193
1193
|
|
1194
1194
|
<div id="footer">
|
1195
|
-
Generated on
|
1195
|
+
Generated on Wed Nov 8 16:39:47 2023 by
|
1196
1196
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1197
1197
|
0.9.34 (ruby-3.2.2).
|
1198
1198
|
</div>
|
data/docs/Mangrove/Option.html
CHANGED
@@ -1135,7 +1135,7 @@
|
|
1135
1135
|
</div>
|
1136
1136
|
|
1137
1137
|
<div id="footer">
|
1138
|
-
Generated on
|
1138
|
+
Generated on Wed Nov 8 16:39:46 2023 by
|
1139
1139
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1140
1140
|
0.9.34 (ruby-3.2.2).
|
1141
1141
|
</div>
|
@@ -424,7 +424,7 @@
|
|
424
424
|
</div>
|
425
425
|
|
426
426
|
<div id="footer">
|
427
|
-
Generated on
|
427
|
+
Generated on Wed Nov 8 16:39:48 2023 by
|
428
428
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
429
429
|
0.9.34 (ruby-3.2.2).
|
430
430
|
</div>
|
@@ -627,7 +627,7 @@
|
|
627
627
|
|
628
628
|
|
629
629
|
<h3 class="inherited">Methods included from <span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Mangrove::Result</a></span></h3>
|
630
|
-
<p class="inherited"><span class='object_link'><a href="../Result.html#err-class_method" title="Mangrove::Result.err (method)">err</a></span>, <span class='object_link'><a href="../Result.html#from_results-class_method" title="Mangrove::Result.from_results (method)">from_results</a></span>, <span class='object_link'><a href="../Result.html#ok-class_method" title="Mangrove::Result.ok (method)">ok</a></span></p>
|
630
|
+
<p class="inherited"><span class='object_link'><a href="../Result.html#err-class_method" title="Mangrove::Result.err (method)">err</a></span>, <span class='object_link'><a href="../Result.html#err_wt-class_method" title="Mangrove::Result.err_wt (method)">err_wt</a></span>, <span class='object_link'><a href="../Result.html#from_results-class_method" title="Mangrove::Result.from_results (method)">from_results</a></span>, <span class='object_link'><a href="../Result.html#ok-class_method" title="Mangrove::Result.ok (method)">ok</a></span>, <span class='object_link'><a href="../Result.html#ok_wt-class_method" title="Mangrove::Result.ok_wt (method)">ok_wt</a></span></p>
|
631
631
|
|
632
632
|
|
633
633
|
|
@@ -674,12 +674,12 @@
|
|
674
674
|
<pre class="lines">
|
675
675
|
|
676
676
|
|
677
|
-
|
678
|
-
|
679
|
-
|
677
|
+
249
|
678
|
+
250
|
679
|
+
251</pre>
|
680
680
|
</td>
|
681
681
|
<td>
|
682
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
682
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 249</span>
|
683
683
|
|
684
684
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_inner'>inner</span><span class='rparen'>)</span>
|
685
685
|
<span class='ivar'>@inner</span> <span class='op'>=</span> <span class='id identifier rubyid_inner'>inner</span>
|
@@ -748,19 +748,20 @@
|
|
748
748
|
<pre class="lines">
|
749
749
|
|
750
750
|
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
751
|
+
254
|
752
|
+
255
|
753
|
+
256
|
754
|
+
257
|
755
|
+
258
|
756
|
+
259
|
757
|
+
260
|
758
|
+
261
|
759
|
+
262
|
760
|
+
263
|
761
|
+
264</pre>
|
761
762
|
</td>
|
762
763
|
<td>
|
763
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
764
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 254</span>
|
764
765
|
|
765
766
|
<span class='kw'>def</span> <span class='op'>==</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
|
766
767
|
<span class='kw'>case</span> <span class='id identifier rubyid_other'>other</span>
|
@@ -768,8 +769,9 @@
|
|
768
769
|
<span class='kw'>false</span>
|
769
770
|
<span class='kw'>when</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Mangrove::Result::Err (class)">Err</a></span></span>
|
770
771
|
<span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_instance_variable_get'>instance_variable_get</span><span class='lparen'>(</span><span class='symbol'>:@inner</span><span class='rparen'>)</span> <span class='op'>==</span> <span class='ivar'>@inner</span>
|
771
|
-
<span class='kw'>else</span>
|
772
|
-
<span class='
|
772
|
+
<span class='kw'>else</span> <span class='comment'># rubocop:disable Lint/DuplicateBranch
|
773
|
+
</span> <span class='comment'># Because == is defined on BasicObject, we can't be sure that `other` is an Option
|
774
|
+
</span> <span class='kw'>false</span>
|
773
775
|
<span class='kw'>end</span>
|
774
776
|
<span class='kw'>end</span></pre>
|
775
777
|
</td>
|
@@ -829,12 +831,12 @@
|
|
829
831
|
<pre class="lines">
|
830
832
|
|
831
833
|
|
832
|
-
|
833
|
-
|
834
|
-
|
834
|
+
324
|
835
|
+
325
|
836
|
+
326</pre>
|
835
837
|
</td>
|
836
838
|
<td>
|
837
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
839
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 324</span>
|
838
840
|
|
839
841
|
<span class='kw'>def</span> <span class='kw'>and</span><span class='lparen'>(</span><span class='id identifier rubyid__other'>_other</span><span class='rparen'>)</span>
|
840
842
|
<span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='lbracket'>[</span><span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_type_parameter'>type_parameter</span><span class='lparen'>(</span><span class='symbol'>:NewOkType</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
@@ -896,12 +898,12 @@
|
|
896
898
|
<pre class="lines">
|
897
899
|
|
898
900
|
|
899
|
-
|
900
|
-
|
901
|
-
|
901
|
+
329
|
902
|
+
330
|
903
|
+
331</pre>
|
902
904
|
</td>
|
903
905
|
<td>
|
904
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
906
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 329</span>
|
905
907
|
|
906
908
|
<span class='kw'>def</span> <span class='id identifier rubyid_and_then'>and_then</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid__block'>_block</span><span class='rparen'>)</span>
|
907
909
|
<span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='lbracket'>[</span><span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_type_parameter'>type_parameter</span><span class='lparen'>(</span><span class='symbol'>:NewOkType</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
@@ -974,12 +976,12 @@
|
|
974
976
|
<pre class="lines">
|
975
977
|
|
976
978
|
|
977
|
-
|
978
|
-
|
979
|
-
|
979
|
+
334
|
980
|
+
335
|
981
|
+
336</pre>
|
980
982
|
</td>
|
981
983
|
<td>
|
982
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
984
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 334</span>
|
983
985
|
|
984
986
|
<span class='kw'>def</span> <span class='id identifier rubyid_and_then_wt'>and_then_wt</span><span class='lparen'>(</span><span class='id identifier rubyid__t_new_ok'>_t_new_ok</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid__block'>_block</span><span class='rparen'>)</span>
|
985
987
|
<span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='lbracket'>[</span><span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_type_parameter'>type_parameter</span><span class='lparen'>(</span><span class='symbol'>:NewOkType</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
@@ -1026,10 +1028,10 @@
|
|
1026
1028
|
<pre class="lines">
|
1027
1029
|
|
1028
1030
|
|
1029
|
-
|
1031
|
+
290</pre>
|
1030
1032
|
</td>
|
1031
1033
|
<td>
|
1032
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1034
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 290</span>
|
1033
1035
|
|
1034
1036
|
<span class='kw'>def</span> <span class='id identifier rubyid_err?'>err?</span> <span class='op'>=</span> <span class='kw'>true</span></pre>
|
1035
1037
|
</td>
|
@@ -1074,12 +1076,12 @@
|
|
1074
1076
|
<pre class="lines">
|
1075
1077
|
|
1076
1078
|
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1079
|
+
267
|
1080
|
+
268
|
1081
|
+
269</pre>
|
1080
1082
|
</td>
|
1081
1083
|
<td>
|
1082
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1084
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 267</span>
|
1083
1085
|
|
1084
1086
|
<span class='kw'>def</span> <span class='id identifier rubyid_err_inner'>err_inner</span>
|
1085
1087
|
<span class='ivar'>@inner</span>
|
@@ -1154,12 +1156,12 @@
|
|
1154
1156
|
<pre class="lines">
|
1155
1157
|
|
1156
1158
|
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1159
|
+
277
|
1160
|
+
278
|
1161
|
+
279</pre>
|
1160
1162
|
</td>
|
1161
1163
|
<td>
|
1162
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1164
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 277</span>
|
1163
1165
|
|
1164
1166
|
<span class='kw'>def</span> <span class='id identifier rubyid_expect!'>expect!</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
1165
1167
|
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ControlSignal.html" title="Mangrove::Result::ControlSignal (class)">ControlSignal</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span>
|
@@ -1193,7 +1195,7 @@
|
|
1193
1195
|
<span class='name'>block</span>
|
1194
1196
|
|
1195
1197
|
|
1196
|
-
<span class='type'>(<tt>T.proc.returns(T.
|
1198
|
+
<span class='type'>(<tt>T.proc.returns(T.type_parameter(:E))</tt>)</span>
|
1197
1199
|
|
1198
1200
|
|
1199
1201
|
|
@@ -1234,12 +1236,12 @@
|
|
1234
1236
|
<pre class="lines">
|
1235
1237
|
|
1236
1238
|
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1239
|
+
282
|
1240
|
+
283
|
1241
|
+
284</pre>
|
1240
1242
|
</td>
|
1241
1243
|
<td>
|
1242
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1244
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 282</span>
|
1243
1245
|
|
1244
1246
|
<span class='kw'>def</span> <span class='id identifier rubyid_expect_with!'>expect_with!</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
1245
1247
|
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ControlSignal.html" title="Mangrove::Result::ControlSignal (class)">ControlSignal</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
|
@@ -1301,12 +1303,12 @@
|
|
1301
1303
|
<pre class="lines">
|
1302
1304
|
|
1303
1305
|
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1306
|
+
293
|
1307
|
+
294
|
1308
|
+
295</pre>
|
1307
1309
|
</td>
|
1308
1310
|
<td>
|
1309
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1311
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 293</span>
|
1310
1312
|
|
1311
1313
|
<span class='kw'>def</span> <span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
1312
1314
|
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
@@ -1368,12 +1370,12 @@
|
|
1368
1370
|
<pre class="lines">
|
1369
1371
|
|
1370
1372
|
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1373
|
+
314
|
1374
|
+
315
|
1375
|
+
316</pre>
|
1374
1376
|
</td>
|
1375
1377
|
<td>
|
1376
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1378
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 314</span>
|
1377
1379
|
|
1378
1380
|
<span class='kw'>def</span> <span class='id identifier rubyid_map_err'>map_err</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
1379
1381
|
<span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span></span><span class='comma'>,</span> <span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_type_parameter'>type_parameter</span><span class='lparen'>(</span><span class='symbol'>:NewErrType</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='ivar'>@inner</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
@@ -1446,12 +1448,12 @@
|
|
1446
1448
|
<pre class="lines">
|
1447
1449
|
|
1448
1450
|
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1451
|
+
319
|
1452
|
+
320
|
1453
|
+
321</pre>
|
1452
1454
|
</td>
|
1453
1455
|
<td>
|
1454
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1456
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 319</span>
|
1455
1457
|
|
1456
1458
|
<span class='kw'>def</span> <span class='id identifier rubyid_map_err_wt'>map_err_wt</span><span class='lparen'>(</span><span class='id identifier rubyid__t_new_err'>_t_new_err</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
1457
1459
|
<span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::Err::OkType (constant)">OkType</a></span></span><span class='comma'>,</span> <span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_type_parameter'>type_parameter</span><span class='lparen'>(</span><span class='symbol'>:NewErrType</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='ivar'>@inner</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
@@ -1513,12 +1515,12 @@
|
|
1513
1515
|
<pre class="lines">
|
1514
1516
|
|
1515
1517
|
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1518
|
+
303
|
1519
|
+
304
|
1520
|
+
305</pre>
|
1519
1521
|
</td>
|
1520
1522
|
<td>
|
1521
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1523
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 303</span>
|
1522
1524
|
|
1523
1525
|
<span class='kw'>def</span> <span class='id identifier rubyid_map_ok'>map_ok</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid__block'>_block</span><span class='rparen'>)</span>
|
1524
1526
|
<span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='lbracket'>[</span><span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_type_parameter'>type_parameter</span><span class='lparen'>(</span><span class='symbol'>:NewOkType</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
@@ -1593,12 +1595,12 @@
|
|
1593
1595
|
<pre class="lines">
|
1594
1596
|
|
1595
1597
|
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1598
|
+
309
|
1599
|
+
310
|
1600
|
+
311</pre>
|
1599
1601
|
</td>
|
1600
1602
|
<td>
|
1601
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1603
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 309</span>
|
1602
1604
|
|
1603
1605
|
<span class='kw'>def</span> <span class='id identifier rubyid_map_ok_wt'>map_ok_wt</span><span class='lparen'>(</span><span class='id identifier rubyid__t_new_ok'>_t_new_ok</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid__block'>_block</span><span class='rparen'>)</span>
|
1604
1606
|
<span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='lbracket'>[</span><span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_type_parameter'>type_parameter</span><span class='lparen'>(</span><span class='symbol'>:NewOkType</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::Err::ErrType (constant)">ErrType</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
@@ -1682,12 +1684,12 @@
|
|
1682
1684
|
<pre class="lines">
|
1683
1685
|
|
1684
1686
|
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1687
|
+
298
|
1688
|
+
299
|
1689
|
+
300</pre>
|
1688
1690
|
</td>
|
1689
1691
|
<td>
|
1690
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1692
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 298</span>
|
1691
1693
|
|
1692
1694
|
<span class='kw'>def</span> <span class='id identifier rubyid_map_wt'>map_wt</span><span class='lparen'>(</span><span class='id identifier rubyid__t_new_ok'>_t_new_ok</span><span class='comma'>,</span> <span class='id identifier rubyid__t_new_err'>_t_new_err</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
1693
1695
|
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
@@ -1734,10 +1736,10 @@
|
|
1734
1736
|
<pre class="lines">
|
1735
1737
|
|
1736
1738
|
|
1737
|
-
|
1739
|
+
287</pre>
|
1738
1740
|
</td>
|
1739
1741
|
<td>
|
1740
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1742
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 287</span>
|
1741
1743
|
|
1742
1744
|
<span class='kw'>def</span> <span class='id identifier rubyid_ok?'>ok?</span> <span class='op'>=</span> <span class='kw'>false</span></pre>
|
1743
1745
|
</td>
|
@@ -1797,12 +1799,12 @@
|
|
1797
1799
|
<pre class="lines">
|
1798
1800
|
|
1799
1801
|
|
1800
|
-
|
1801
|
-
|
1802
|
-
|
1802
|
+
339
|
1803
|
+
340
|
1804
|
+
341</pre>
|
1803
1805
|
</td>
|
1804
1806
|
<td>
|
1805
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1807
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 339</span>
|
1806
1808
|
|
1807
1809
|
<span class='kw'>def</span> <span class='kw'>or</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
|
1808
1810
|
<span class='id identifier rubyid_other'>other</span>
|
@@ -1864,12 +1866,12 @@
|
|
1864
1866
|
<pre class="lines">
|
1865
1867
|
|
1866
1868
|
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1869
|
+
344
|
1870
|
+
345
|
1871
|
+
346</pre>
|
1870
1872
|
</td>
|
1871
1873
|
<td>
|
1872
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1874
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 344</span>
|
1873
1875
|
|
1874
1876
|
<span class='kw'>def</span> <span class='id identifier rubyid_or_else'>or_else</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
1875
1877
|
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='ivar'>@inner</span><span class='rparen'>)</span>
|
@@ -1942,12 +1944,12 @@
|
|
1942
1944
|
<pre class="lines">
|
1943
1945
|
|
1944
1946
|
|
1945
|
-
|
1946
|
-
|
1947
|
-
|
1947
|
+
349
|
1948
|
+
350
|
1949
|
+
351</pre>
|
1948
1950
|
</td>
|
1949
1951
|
<td>
|
1950
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1952
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 349</span>
|
1951
1953
|
|
1952
1954
|
<span class='kw'>def</span> <span class='id identifier rubyid_or_else_wt'>or_else_wt</span><span class='lparen'>(</span><span class='id identifier rubyid__t_new_err'>_t_new_err</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
1953
1955
|
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='ivar'>@inner</span><span class='rparen'>)</span>
|
@@ -1994,12 +1996,12 @@
|
|
1994
1996
|
<pre class="lines">
|
1995
1997
|
|
1996
1998
|
|
1997
|
-
|
1998
|
-
|
1999
|
-
|
1999
|
+
354
|
2000
|
+
355
|
2001
|
+
356</pre>
|
2000
2002
|
</td>
|
2001
2003
|
<td>
|
2002
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
2004
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 354</span>
|
2003
2005
|
|
2004
2006
|
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
|
2005
2007
|
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='kw'>super</span><span class='embexpr_end'>}</span><span class='tstring_content'>: inner=`</span><span class='embexpr_beg'>#{</span><span class='ivar'>@inner</span><span class='embexpr_end'>}</span><span class='tstring_content'>`</span><span class='tstring_end'>"</span></span>
|
@@ -2059,12 +2061,12 @@
|
|
2059
2061
|
<pre class="lines">
|
2060
2062
|
|
2061
2063
|
|
2062
|
-
|
2063
|
-
|
2064
|
-
|
2064
|
+
272
|
2065
|
+
273
|
2066
|
+
274</pre>
|
2065
2067
|
</td>
|
2066
2068
|
<td>
|
2067
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
2069
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 272</span>
|
2068
2070
|
|
2069
2071
|
<span class='kw'>def</span> <span class='id identifier rubyid_unwrap!'>unwrap!</span>
|
2070
2072
|
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ControlSignal.html" title="Mangrove::Result::ControlSignal (class)">ControlSignal</a></span></span><span class='comma'>,</span> <span class='ivar'>@inner</span>
|
@@ -2079,7 +2081,7 @@
|
|
2079
2081
|
</div>
|
2080
2082
|
|
2081
2083
|
<div id="footer">
|
2082
|
-
Generated on
|
2084
|
+
Generated on Wed Nov 8 16:39:48 2023 by
|
2083
2085
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2084
2086
|
0.9.34 (ruby-3.2.2).
|
2085
2087
|
</div>
|