mangrove 0.12.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- 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 +1 -1
- data/docs/Mangrove/Option/Some.html +1 -1
- data/docs/Mangrove/Option.html +1 -1
- data/docs/Mangrove/Result/ControlSignal.html +1 -1
- data/docs/Mangrove/Result/Err.html +1039 -79
- data/docs/Mangrove/Result/Ok.html +1049 -85
- data/docs/Mangrove/Result.html +1231 -97
- data/docs/Mangrove.html +2 -2
- data/docs/_index.html +1 -1
- data/docs/file.README.html +1 -1
- data/docs/index.html +1 -1
- data/docs/method_list.html +264 -8
- data/docs/top-level-namespace.html +1 -1
- data/lib/mangrove/result.rb +149 -6
- data/lib/mangrove/version.rb +1 -1
- metadata +2 -2
data/docs/Mangrove/Result.html
CHANGED
@@ -166,6 +166,28 @@
|
|
166
166
|
<li class="public ">
|
167
167
|
<span class="summary_signature">
|
168
168
|
|
169
|
+
<a href="#err-class_method" title="err (class method)">.<strong>err</strong>(inner) ⇒ Result::Err[OkType, ErrType] </a>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
</span>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
184
|
+
|
185
|
+
</li>
|
186
|
+
|
187
|
+
|
188
|
+
<li class="public ">
|
189
|
+
<span class="summary_signature">
|
190
|
+
|
169
191
|
<a href="#from_results-class_method" title="from_results (class method)">.<strong>from_results</strong>(results) ⇒ Result[OkType, ErrType] </a>
|
170
192
|
|
171
193
|
|
@@ -180,6 +202,28 @@
|
|
180
202
|
|
181
203
|
|
182
204
|
|
205
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
206
|
+
|
207
|
+
</li>
|
208
|
+
|
209
|
+
|
210
|
+
<li class="public ">
|
211
|
+
<span class="summary_signature">
|
212
|
+
|
213
|
+
<a href="#ok-class_method" title="ok (class method)">.<strong>ok</strong>(inner) ⇒ Result::Ok[OkType, ErrType] </a>
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
</span>
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
183
227
|
<span class="summary_desc"><div class='inline'></div></span>
|
184
228
|
|
185
229
|
</li>
|
@@ -206,6 +250,72 @@
|
|
206
250
|
|
207
251
|
|
208
252
|
|
253
|
+
<span class="abstract note title">abstract</span>
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
259
|
+
|
260
|
+
</li>
|
261
|
+
|
262
|
+
|
263
|
+
<li class="public ">
|
264
|
+
<span class="summary_signature">
|
265
|
+
|
266
|
+
<a href="#and-instance_method" title="#and (instance method)">#<strong>and</strong>(other) ⇒ Result[T.type_parameter(:NewOkType), ErrType] </a>
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
</span>
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
<span class="abstract note title">abstract</span>
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
281
|
+
|
282
|
+
</li>
|
283
|
+
|
284
|
+
|
285
|
+
<li class="public ">
|
286
|
+
<span class="summary_signature">
|
287
|
+
|
288
|
+
<a href="#and_then-instance_method" title="#and_then (instance method)">#<strong>and_then</strong>(&block) ⇒ Result[T.type_parameter(:NewOkType), ErrType] </a>
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
</span>
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
<span class="abstract note title">abstract</span>
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
303
|
+
|
304
|
+
</li>
|
305
|
+
|
306
|
+
|
307
|
+
<li class="public ">
|
308
|
+
<span class="summary_signature">
|
309
|
+
|
310
|
+
<a href="#and_then_wt-instance_method" title="#and_then_wt (instance method)">#<strong>and_then_wt</strong>(_t_new_ok, &block) ⇒ Result[T.type_parameter(:NewOkType), ErrType] </a>
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
</span>
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
209
319
|
<span class="abstract note title">abstract</span>
|
210
320
|
|
211
321
|
|
@@ -272,6 +382,28 @@
|
|
272
382
|
|
273
383
|
|
274
384
|
|
385
|
+
<span class="abstract note title">abstract</span>
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
391
|
+
|
392
|
+
</li>
|
393
|
+
|
394
|
+
|
395
|
+
<li class="public ">
|
396
|
+
<span class="summary_signature">
|
397
|
+
|
398
|
+
<a href="#map-instance_method" title="#map (instance method)">#<strong>map</strong>(&block) ⇒ Result[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)] </a>
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
</span>
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
275
407
|
<span class="abstract note title">abstract</span>
|
276
408
|
|
277
409
|
|
@@ -294,6 +426,28 @@
|
|
294
426
|
|
295
427
|
|
296
428
|
|
429
|
+
<span class="abstract note title">abstract</span>
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
435
|
+
|
436
|
+
</li>
|
437
|
+
|
438
|
+
|
439
|
+
<li class="public ">
|
440
|
+
<span class="summary_signature">
|
441
|
+
|
442
|
+
<a href="#map_err_wt-instance_method" title="#map_err_wt (instance method)">#<strong>map_err_wt</strong>(_t_new_err, &block) ⇒ Result[OkType, T.type_parameter(:NewErrType)] </a>
|
443
|
+
|
444
|
+
|
445
|
+
|
446
|
+
</span>
|
447
|
+
|
448
|
+
|
449
|
+
|
450
|
+
|
297
451
|
<span class="abstract note title">abstract</span>
|
298
452
|
|
299
453
|
|
@@ -316,6 +470,50 @@
|
|
316
470
|
|
317
471
|
|
318
472
|
|
473
|
+
<span class="abstract note title">abstract</span>
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
|
478
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
479
|
+
|
480
|
+
</li>
|
481
|
+
|
482
|
+
|
483
|
+
<li class="public ">
|
484
|
+
<span class="summary_signature">
|
485
|
+
|
486
|
+
<a href="#map_ok_wt-instance_method" title="#map_ok_wt (instance method)">#<strong>map_ok_wt</strong>(_t_new_ok, &block) ⇒ Result[T.type_parameter(:NewOkType), ErrType] </a>
|
487
|
+
|
488
|
+
|
489
|
+
|
490
|
+
</span>
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
<span class="abstract note title">abstract</span>
|
496
|
+
|
497
|
+
|
498
|
+
|
499
|
+
|
500
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
501
|
+
|
502
|
+
</li>
|
503
|
+
|
504
|
+
|
505
|
+
<li class="public ">
|
506
|
+
<span class="summary_signature">
|
507
|
+
|
508
|
+
<a href="#map_wt-instance_method" title="#map_wt (instance method)">#<strong>map_wt</strong>(_t_new_ok, _t_new_err, &block) ⇒ Result[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)] </a>
|
509
|
+
|
510
|
+
|
511
|
+
|
512
|
+
</span>
|
513
|
+
|
514
|
+
|
515
|
+
|
516
|
+
|
319
517
|
<span class="abstract note title">abstract</span>
|
320
518
|
|
321
519
|
|
@@ -338,6 +536,72 @@
|
|
338
536
|
|
339
537
|
|
340
538
|
|
539
|
+
<span class="abstract note title">abstract</span>
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
545
|
+
|
546
|
+
</li>
|
547
|
+
|
548
|
+
|
549
|
+
<li class="public ">
|
550
|
+
<span class="summary_signature">
|
551
|
+
|
552
|
+
<a href="#or-instance_method" title="#or (instance method)">#<strong>or</strong>(other) ⇒ Result[OkType, ErrType] </a>
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
</span>
|
557
|
+
|
558
|
+
|
559
|
+
|
560
|
+
|
561
|
+
<span class="abstract note title">abstract</span>
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
|
566
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
567
|
+
|
568
|
+
</li>
|
569
|
+
|
570
|
+
|
571
|
+
<li class="public ">
|
572
|
+
<span class="summary_signature">
|
573
|
+
|
574
|
+
<a href="#or_else-instance_method" title="#or_else (instance method)">#<strong>or_else</strong>(&block) ⇒ Result[OkType, T.type_parameter(:NewErrType)] </a>
|
575
|
+
|
576
|
+
|
577
|
+
|
578
|
+
</span>
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
<span class="abstract note title">abstract</span>
|
584
|
+
|
585
|
+
|
586
|
+
|
587
|
+
|
588
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
589
|
+
|
590
|
+
</li>
|
591
|
+
|
592
|
+
|
593
|
+
<li class="public ">
|
594
|
+
<span class="summary_signature">
|
595
|
+
|
596
|
+
<a href="#or_else_wt-instance_method" title="#or_else_wt (instance method)">#<strong>or_else_wt</strong>(_t_new_err, &block) ⇒ Result[OkType, T.type_parameter(:NewErrType)] </a>
|
597
|
+
|
598
|
+
|
599
|
+
|
600
|
+
</span>
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
|
341
605
|
<span class="abstract note title">abstract</span>
|
342
606
|
|
343
607
|
|
@@ -367,26 +631,781 @@
|
|
367
631
|
|
368
632
|
<span class="summary_desc"><div class='inline'></div></span>
|
369
633
|
|
370
|
-
</li>
|
371
|
-
|
634
|
+
</li>
|
635
|
+
|
636
|
+
|
637
|
+
</ul>
|
638
|
+
|
639
|
+
|
640
|
+
|
641
|
+
|
642
|
+
|
643
|
+
|
644
|
+
|
645
|
+
|
646
|
+
<div id="class_method_details" class="method_details_list">
|
647
|
+
<h2>Class Method Details</h2>
|
648
|
+
|
649
|
+
|
650
|
+
<div class="method_details first">
|
651
|
+
<h3 class="signature first" id="err-class_method">
|
652
|
+
|
653
|
+
.<strong>err</strong>(inner) ⇒ <tt><span class='object_link'><a href="Result/Err.html" title="Mangrove::Result::Err (class)">Result::Err</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>
|
654
|
+
|
655
|
+
|
656
|
+
|
657
|
+
|
658
|
+
|
659
|
+
</h3><div class="docstring">
|
660
|
+
<div class="discussion">
|
661
|
+
|
662
|
+
|
663
|
+
</div>
|
664
|
+
</div>
|
665
|
+
<div class="tags">
|
666
|
+
<p class="tag_title">Parameters:</p>
|
667
|
+
<ul class="param">
|
668
|
+
|
669
|
+
<li>
|
670
|
+
|
671
|
+
<span class='name'>inner</span>
|
672
|
+
|
673
|
+
|
674
|
+
<span class='type'>(<tt><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span></tt>)</span>
|
675
|
+
|
676
|
+
|
677
|
+
|
678
|
+
</li>
|
679
|
+
|
680
|
+
</ul>
|
681
|
+
|
682
|
+
<p class="tag_title">Returns:</p>
|
683
|
+
<ul class="return">
|
684
|
+
|
685
|
+
<li>
|
686
|
+
|
687
|
+
|
688
|
+
<span class='type'>(<tt><span class='object_link'><a href="Result/Err.html" title="Mangrove::Result::Err (class)">Result::Err</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>)</span>
|
689
|
+
|
690
|
+
|
691
|
+
|
692
|
+
</li>
|
693
|
+
|
694
|
+
</ul>
|
695
|
+
|
696
|
+
</div><table class="source_code">
|
697
|
+
<tr>
|
698
|
+
<td>
|
699
|
+
<pre class="lines">
|
700
|
+
|
701
|
+
|
702
|
+
101
|
703
|
+
102
|
704
|
+
103</pre>
|
705
|
+
</td>
|
706
|
+
<td>
|
707
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 101</span>
|
708
|
+
|
709
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_err'>err</span><span class='lparen'>(</span><span class='id identifier rubyid_inner'>inner</span><span class='rparen'>)</span>
|
710
|
+
<span class='const'><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Result/Err.html" 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::OkType (constant)">OkType</a></span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span></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_inner'>inner</span><span class='rparen'>)</span>
|
711
|
+
<span class='kw'>end</span></pre>
|
712
|
+
</td>
|
713
|
+
</tr>
|
714
|
+
</table>
|
715
|
+
</div>
|
716
|
+
|
717
|
+
<div class="method_details ">
|
718
|
+
<h3 class="signature " id="from_results-class_method">
|
719
|
+
|
720
|
+
.<strong>from_results</strong>(results) ⇒ <tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>
|
721
|
+
|
722
|
+
|
723
|
+
|
724
|
+
|
725
|
+
|
726
|
+
</h3><div class="docstring">
|
727
|
+
<div class="discussion">
|
728
|
+
|
729
|
+
|
730
|
+
</div>
|
731
|
+
</div>
|
732
|
+
<div class="tags">
|
733
|
+
<p class="tag_title">Parameters:</p>
|
734
|
+
<ul class="param">
|
735
|
+
|
736
|
+
<li>
|
737
|
+
|
738
|
+
<span class='name'>results</span>
|
739
|
+
|
740
|
+
|
741
|
+
<span class='type'>(<tt>Enumerable<<span class='object_link'><a href="" title="Mangrove::Result (module)">Mangrove::Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]></tt>)</span>
|
742
|
+
|
743
|
+
|
744
|
+
|
745
|
+
</li>
|
746
|
+
|
747
|
+
</ul>
|
748
|
+
|
749
|
+
<p class="tag_title">Returns:</p>
|
750
|
+
<ul class="return">
|
751
|
+
|
752
|
+
<li>
|
753
|
+
|
754
|
+
|
755
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>)</span>
|
756
|
+
|
757
|
+
|
758
|
+
|
759
|
+
</li>
|
760
|
+
|
761
|
+
</ul>
|
762
|
+
|
763
|
+
</div><table class="source_code">
|
764
|
+
<tr>
|
765
|
+
<td>
|
766
|
+
<pre class="lines">
|
767
|
+
|
768
|
+
|
769
|
+
83
|
770
|
+
84
|
771
|
+
85
|
772
|
+
86
|
773
|
+
87
|
774
|
+
88
|
775
|
+
89
|
776
|
+
90
|
777
|
+
91
|
778
|
+
92
|
779
|
+
93</pre>
|
780
|
+
</td>
|
781
|
+
<td>
|
782
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 83</span>
|
783
|
+
|
784
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_from_results'>from_results</span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='rparen'>)</span>
|
785
|
+
<span class='id identifier rubyid_errs'>errs</span> <span class='op'>=</span> <span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_filter'>filter</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:err?</span><span class='rparen'>)</span>
|
786
|
+
|
787
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_errs'>errs</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
788
|
+
<span class='comment'># This is safe as errs is empty.
|
789
|
+
</span> <span class='const'><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Result/Ok.html" title="Mangrove::Result::Ok (class)">Ok</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Result/Ok.html#initialize-instance_method" title="Mangrove::Result::Ok#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_r'>r</span><span class='op'>|</span> <span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='id identifier rubyid_r'>r</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Result/Ok.html" title="Mangrove::Result::Ok (class)">Ok</a></span></span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_ok_inner'>ok_inner</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
|
790
|
+
<span class='kw'>else</span>
|
791
|
+
<span class='comment'># This is safe as errs is results where err? is true
|
792
|
+
</span> <span class='const'><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Result/Err.html" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Result/Err.html#initialize-instance_method" title="Mangrove::Result::Err#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_errs'>errs</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_r'>r</span><span class='op'>|</span> <span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='id identifier rubyid_r'>r</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Result/Err.html" 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::OkType (constant)">OkType</a></span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_err_inner'>err_inner</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
|
793
|
+
<span class='kw'>end</span>
|
794
|
+
<span class='kw'>end</span></pre>
|
795
|
+
</td>
|
796
|
+
</tr>
|
797
|
+
</table>
|
798
|
+
</div>
|
799
|
+
|
800
|
+
<div class="method_details ">
|
801
|
+
<h3 class="signature " id="ok-class_method">
|
802
|
+
|
803
|
+
.<strong>ok</strong>(inner) ⇒ <tt><span class='object_link'><a href="Result/Ok.html" title="Mangrove::Result::Ok (class)">Result::Ok</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>
|
804
|
+
|
805
|
+
|
806
|
+
|
807
|
+
|
808
|
+
|
809
|
+
</h3><div class="docstring">
|
810
|
+
<div class="discussion">
|
811
|
+
|
812
|
+
|
813
|
+
</div>
|
814
|
+
</div>
|
815
|
+
<div class="tags">
|
816
|
+
<p class="tag_title">Parameters:</p>
|
817
|
+
<ul class="param">
|
818
|
+
|
819
|
+
<li>
|
820
|
+
|
821
|
+
<span class='name'>inner</span>
|
822
|
+
|
823
|
+
|
824
|
+
<span class='type'>(<tt><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span></tt>)</span>
|
825
|
+
|
826
|
+
|
827
|
+
|
828
|
+
</li>
|
829
|
+
|
830
|
+
</ul>
|
831
|
+
|
832
|
+
<p class="tag_title">Returns:</p>
|
833
|
+
<ul class="return">
|
834
|
+
|
835
|
+
<li>
|
836
|
+
|
837
|
+
|
838
|
+
<span class='type'>(<tt><span class='object_link'><a href="Result/Ok.html" title="Mangrove::Result::Ok (class)">Result::Ok</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>)</span>
|
839
|
+
|
840
|
+
|
841
|
+
|
842
|
+
</li>
|
843
|
+
|
844
|
+
</ul>
|
845
|
+
|
846
|
+
</div><table class="source_code">
|
847
|
+
<tr>
|
848
|
+
<td>
|
849
|
+
<pre class="lines">
|
850
|
+
|
851
|
+
|
852
|
+
96
|
853
|
+
97
|
854
|
+
98</pre>
|
855
|
+
</td>
|
856
|
+
<td>
|
857
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 96</span>
|
858
|
+
|
859
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_ok'>ok</span><span class='lparen'>(</span><span class='id identifier rubyid_inner'>inner</span><span class='rparen'>)</span>
|
860
|
+
<span class='const'><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Result/Ok.html" title="Mangrove::Result::Ok (class)">Ok</a></span></span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span></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_inner'>inner</span><span class='rparen'>)</span>
|
861
|
+
<span class='kw'>end</span></pre>
|
862
|
+
</td>
|
863
|
+
</tr>
|
864
|
+
</table>
|
865
|
+
</div>
|
866
|
+
|
867
|
+
</div>
|
868
|
+
|
869
|
+
<div id="instance_method_details" class="method_details_list">
|
870
|
+
<h2>Instance Method Details</h2>
|
871
|
+
|
872
|
+
|
873
|
+
<div class="method_details first">
|
874
|
+
<h3 class="signature first" id="==-instance_method">
|
875
|
+
|
876
|
+
#<strong>==</strong>(other) ⇒ <tt>Boolean</tt>
|
877
|
+
|
878
|
+
|
879
|
+
|
880
|
+
|
881
|
+
|
882
|
+
</h3><div class="docstring">
|
883
|
+
<div class="discussion">
|
884
|
+
<div class="note abstract">
|
885
|
+
<strong>This method is abstract.</strong>
|
886
|
+
<div class='inline'></div>
|
887
|
+
</div>
|
888
|
+
|
889
|
+
|
890
|
+
</div>
|
891
|
+
</div>
|
892
|
+
<div class="tags">
|
893
|
+
<p class="tag_title">Parameters:</p>
|
894
|
+
<ul class="param">
|
895
|
+
|
896
|
+
<li>
|
897
|
+
|
898
|
+
<span class='name'>other</span>
|
899
|
+
|
900
|
+
|
901
|
+
<span class='type'>(<tt>BasicObject</tt>)</span>
|
902
|
+
|
903
|
+
|
904
|
+
|
905
|
+
</li>
|
906
|
+
|
907
|
+
</ul>
|
908
|
+
|
909
|
+
<p class="tag_title">Returns:</p>
|
910
|
+
<ul class="return">
|
911
|
+
|
912
|
+
<li>
|
913
|
+
|
914
|
+
|
915
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
916
|
+
|
917
|
+
|
918
|
+
|
919
|
+
</li>
|
920
|
+
|
921
|
+
</ul>
|
922
|
+
|
923
|
+
</div><table class="source_code">
|
924
|
+
<tr>
|
925
|
+
<td>
|
926
|
+
<pre class="lines">
|
927
|
+
|
928
|
+
|
929
|
+
22</pre>
|
930
|
+
</td>
|
931
|
+
<td>
|
932
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 22</span>
|
933
|
+
|
934
|
+
<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><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
935
|
+
</td>
|
936
|
+
</tr>
|
937
|
+
</table>
|
938
|
+
</div>
|
939
|
+
|
940
|
+
<div class="method_details ">
|
941
|
+
<h3 class="signature " id="and-instance_method">
|
942
|
+
|
943
|
+
#<strong>and</strong>(other) ⇒ <tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>
|
944
|
+
|
945
|
+
|
946
|
+
|
947
|
+
|
948
|
+
|
949
|
+
</h3><div class="docstring">
|
950
|
+
<div class="discussion">
|
951
|
+
<div class="note abstract">
|
952
|
+
<strong>This method is abstract.</strong>
|
953
|
+
<div class='inline'></div>
|
954
|
+
</div>
|
955
|
+
|
956
|
+
|
957
|
+
</div>
|
958
|
+
</div>
|
959
|
+
<div class="tags">
|
960
|
+
<p class="tag_title">Parameters:</p>
|
961
|
+
<ul class="param">
|
962
|
+
|
963
|
+
<li>
|
964
|
+
|
965
|
+
<span class='name'>other</span>
|
966
|
+
|
967
|
+
|
968
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>)</span>
|
969
|
+
|
970
|
+
|
971
|
+
|
972
|
+
</li>
|
973
|
+
|
974
|
+
</ul>
|
975
|
+
|
976
|
+
<p class="tag_title">Returns:</p>
|
977
|
+
<ul class="return">
|
978
|
+
|
979
|
+
<li>
|
980
|
+
|
981
|
+
|
982
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>)</span>
|
983
|
+
|
984
|
+
|
985
|
+
|
986
|
+
</li>
|
987
|
+
|
988
|
+
</ul>
|
989
|
+
|
990
|
+
</div><table class="source_code">
|
991
|
+
<tr>
|
992
|
+
<td>
|
993
|
+
<pre class="lines">
|
994
|
+
|
995
|
+
|
996
|
+
58</pre>
|
997
|
+
</td>
|
998
|
+
<td>
|
999
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 58</span>
|
1000
|
+
|
1001
|
+
<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><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
1002
|
+
</td>
|
1003
|
+
</tr>
|
1004
|
+
</table>
|
1005
|
+
</div>
|
1006
|
+
|
1007
|
+
<div class="method_details ">
|
1008
|
+
<h3 class="signature " id="and_then-instance_method">
|
1009
|
+
|
1010
|
+
#<strong>and_then</strong>(&block) ⇒ <tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>
|
1011
|
+
|
1012
|
+
|
1013
|
+
|
1014
|
+
|
1015
|
+
|
1016
|
+
</h3><div class="docstring">
|
1017
|
+
<div class="discussion">
|
1018
|
+
<div class="note abstract">
|
1019
|
+
<strong>This method is abstract.</strong>
|
1020
|
+
<div class='inline'></div>
|
1021
|
+
</div>
|
1022
|
+
|
1023
|
+
|
1024
|
+
</div>
|
1025
|
+
</div>
|
1026
|
+
<div class="tags">
|
1027
|
+
<p class="tag_title">Parameters:</p>
|
1028
|
+
<ul class="param">
|
1029
|
+
|
1030
|
+
<li>
|
1031
|
+
|
1032
|
+
<span class='name'>block</span>
|
1033
|
+
|
1034
|
+
|
1035
|
+
<span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>).returns(<span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>])</tt>)</span>
|
1036
|
+
|
1037
|
+
|
1038
|
+
|
1039
|
+
</li>
|
1040
|
+
|
1041
|
+
</ul>
|
1042
|
+
|
1043
|
+
<p class="tag_title">Returns:</p>
|
1044
|
+
<ul class="return">
|
1045
|
+
|
1046
|
+
<li>
|
1047
|
+
|
1048
|
+
|
1049
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>)</span>
|
1050
|
+
|
1051
|
+
|
1052
|
+
|
1053
|
+
</li>
|
1054
|
+
|
1055
|
+
</ul>
|
1056
|
+
|
1057
|
+
</div><table class="source_code">
|
1058
|
+
<tr>
|
1059
|
+
<td>
|
1060
|
+
<pre class="lines">
|
1061
|
+
|
1062
|
+
|
1063
|
+
61</pre>
|
1064
|
+
</td>
|
1065
|
+
<td>
|
1066
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 61</span>
|
1067
|
+
|
1068
|
+
<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><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
1069
|
+
</td>
|
1070
|
+
</tr>
|
1071
|
+
</table>
|
1072
|
+
</div>
|
1073
|
+
|
1074
|
+
<div class="method_details ">
|
1075
|
+
<h3 class="signature " id="and_then_wt-instance_method">
|
1076
|
+
|
1077
|
+
#<strong>and_then_wt</strong>(_t_new_ok, &block) ⇒ <tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>
|
1078
|
+
|
1079
|
+
|
1080
|
+
|
1081
|
+
|
1082
|
+
|
1083
|
+
</h3><div class="docstring">
|
1084
|
+
<div class="discussion">
|
1085
|
+
<div class="note abstract">
|
1086
|
+
<strong>This method is abstract.</strong>
|
1087
|
+
<div class='inline'></div>
|
1088
|
+
</div>
|
1089
|
+
|
1090
|
+
|
1091
|
+
</div>
|
1092
|
+
</div>
|
1093
|
+
<div class="tags">
|
1094
|
+
<p class="tag_title">Parameters:</p>
|
1095
|
+
<ul class="param">
|
1096
|
+
|
1097
|
+
<li>
|
1098
|
+
|
1099
|
+
<span class='name'>_t_new_ok</span>
|
1100
|
+
|
1101
|
+
|
1102
|
+
<span class='type'>(<tt>T::Class[T.type_parameter(:NewOkType)]</tt>)</span>
|
1103
|
+
|
1104
|
+
|
1105
|
+
|
1106
|
+
</li>
|
1107
|
+
|
1108
|
+
<li>
|
1109
|
+
|
1110
|
+
<span class='name'>block</span>
|
1111
|
+
|
1112
|
+
|
1113
|
+
<span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>).returns(<span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>])</tt>)</span>
|
1114
|
+
|
1115
|
+
|
1116
|
+
|
1117
|
+
</li>
|
1118
|
+
|
1119
|
+
</ul>
|
1120
|
+
|
1121
|
+
<p class="tag_title">Returns:</p>
|
1122
|
+
<ul class="return">
|
1123
|
+
|
1124
|
+
<li>
|
1125
|
+
|
1126
|
+
|
1127
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>)</span>
|
1128
|
+
|
1129
|
+
|
1130
|
+
|
1131
|
+
</li>
|
1132
|
+
|
1133
|
+
</ul>
|
1134
|
+
|
1135
|
+
</div><table class="source_code">
|
1136
|
+
<tr>
|
1137
|
+
<td>
|
1138
|
+
<pre class="lines">
|
1139
|
+
|
1140
|
+
|
1141
|
+
64</pre>
|
1142
|
+
</td>
|
1143
|
+
<td>
|
1144
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 64</span>
|
1145
|
+
|
1146
|
+
<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><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
1147
|
+
</td>
|
1148
|
+
</tr>
|
1149
|
+
</table>
|
1150
|
+
</div>
|
1151
|
+
|
1152
|
+
<div class="method_details ">
|
1153
|
+
<h3 class="signature " id="err?-instance_method">
|
1154
|
+
|
1155
|
+
#<strong>err?</strong> ⇒ <tt>Boolean</tt>
|
1156
|
+
|
1157
|
+
|
1158
|
+
|
1159
|
+
|
1160
|
+
|
1161
|
+
</h3><div class="docstring">
|
1162
|
+
<div class="discussion">
|
1163
|
+
<div class="note abstract">
|
1164
|
+
<strong>This method is abstract.</strong>
|
1165
|
+
<div class='inline'></div>
|
1166
|
+
</div>
|
1167
|
+
|
1168
|
+
|
1169
|
+
</div>
|
1170
|
+
</div>
|
1171
|
+
<div class="tags">
|
1172
|
+
|
1173
|
+
<p class="tag_title">Returns:</p>
|
1174
|
+
<ul class="return">
|
1175
|
+
|
1176
|
+
<li>
|
1177
|
+
|
1178
|
+
|
1179
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1180
|
+
|
1181
|
+
|
1182
|
+
|
1183
|
+
</li>
|
1184
|
+
|
1185
|
+
</ul>
|
1186
|
+
|
1187
|
+
</div><table class="source_code">
|
1188
|
+
<tr>
|
1189
|
+
<td>
|
1190
|
+
<pre class="lines">
|
1191
|
+
|
1192
|
+
|
1193
|
+
28</pre>
|
1194
|
+
</td>
|
1195
|
+
<td>
|
1196
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 28</span>
|
1197
|
+
|
1198
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_err?'>err?</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
1199
|
+
</td>
|
1200
|
+
</tr>
|
1201
|
+
</table>
|
1202
|
+
</div>
|
1203
|
+
|
1204
|
+
<div class="method_details ">
|
1205
|
+
<h3 class="signature " id="expect!-instance_method">
|
1206
|
+
|
1207
|
+
#<strong>expect!</strong>(message) ⇒ <tt><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span></tt>
|
1208
|
+
|
1209
|
+
|
1210
|
+
|
1211
|
+
|
1212
|
+
|
1213
|
+
</h3><div class="docstring">
|
1214
|
+
<div class="discussion">
|
1215
|
+
<div class="note abstract">
|
1216
|
+
<strong>This method is abstract.</strong>
|
1217
|
+
<div class='inline'></div>
|
1218
|
+
</div>
|
1219
|
+
|
1220
|
+
|
1221
|
+
</div>
|
1222
|
+
</div>
|
1223
|
+
<div class="tags">
|
1224
|
+
<p class="tag_title">Parameters:</p>
|
1225
|
+
<ul class="param">
|
1226
|
+
|
1227
|
+
<li>
|
1228
|
+
|
1229
|
+
<span class='name'>message</span>
|
1230
|
+
|
1231
|
+
|
1232
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1233
|
+
|
1234
|
+
|
1235
|
+
|
1236
|
+
</li>
|
1237
|
+
|
1238
|
+
</ul>
|
1239
|
+
|
1240
|
+
<p class="tag_title">Returns:</p>
|
1241
|
+
<ul class="return">
|
1242
|
+
|
1243
|
+
<li>
|
1244
|
+
|
1245
|
+
|
1246
|
+
<span class='type'>(<tt><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span></tt>)</span>
|
1247
|
+
|
1248
|
+
|
1249
|
+
|
1250
|
+
</li>
|
1251
|
+
|
1252
|
+
</ul>
|
1253
|
+
|
1254
|
+
</div><table class="source_code">
|
1255
|
+
<tr>
|
1256
|
+
<td>
|
1257
|
+
<pre class="lines">
|
1258
|
+
|
1259
|
+
|
1260
|
+
34</pre>
|
1261
|
+
</td>
|
1262
|
+
<td>
|
1263
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 34</span>
|
1264
|
+
|
1265
|
+
<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><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
1266
|
+
</td>
|
1267
|
+
</tr>
|
1268
|
+
</table>
|
1269
|
+
</div>
|
1270
|
+
|
1271
|
+
<div class="method_details ">
|
1272
|
+
<h3 class="signature " id="expect_with!-instance_method">
|
1273
|
+
|
1274
|
+
#<strong>expect_with!</strong>(&block) ⇒ <tt><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span></tt>
|
1275
|
+
|
1276
|
+
|
1277
|
+
|
1278
|
+
|
1279
|
+
|
1280
|
+
</h3><div class="docstring">
|
1281
|
+
<div class="discussion">
|
1282
|
+
<div class="note abstract">
|
1283
|
+
<strong>This method is abstract.</strong>
|
1284
|
+
<div class='inline'></div>
|
1285
|
+
</div>
|
1286
|
+
|
1287
|
+
|
1288
|
+
</div>
|
1289
|
+
</div>
|
1290
|
+
<div class="tags">
|
1291
|
+
<p class="tag_title">Parameters:</p>
|
1292
|
+
<ul class="param">
|
1293
|
+
|
1294
|
+
<li>
|
1295
|
+
|
1296
|
+
<span class='name'>block</span>
|
1297
|
+
|
1298
|
+
|
1299
|
+
<span class='type'>(<tt>T.proc.returns(T.untyped)</tt>)</span>
|
1300
|
+
|
1301
|
+
|
1302
|
+
|
1303
|
+
</li>
|
1304
|
+
|
1305
|
+
</ul>
|
1306
|
+
|
1307
|
+
<p class="tag_title">Returns:</p>
|
1308
|
+
<ul class="return">
|
1309
|
+
|
1310
|
+
<li>
|
1311
|
+
|
1312
|
+
|
1313
|
+
<span class='type'>(<tt><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span></tt>)</span>
|
1314
|
+
|
1315
|
+
|
1316
|
+
|
1317
|
+
</li>
|
1318
|
+
|
1319
|
+
</ul>
|
1320
|
+
|
1321
|
+
</div><table class="source_code">
|
1322
|
+
<tr>
|
1323
|
+
<td>
|
1324
|
+
<pre class="lines">
|
1325
|
+
|
1326
|
+
|
1327
|
+
37</pre>
|
1328
|
+
</td>
|
1329
|
+
<td>
|
1330
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 37</span>
|
1331
|
+
|
1332
|
+
<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><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
1333
|
+
</td>
|
1334
|
+
</tr>
|
1335
|
+
</table>
|
1336
|
+
</div>
|
1337
|
+
|
1338
|
+
<div class="method_details ">
|
1339
|
+
<h3 class="signature " id="map-instance_method">
|
1340
|
+
|
1341
|
+
#<strong>map</strong>(&block) ⇒ <tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)]</tt>
|
1342
|
+
|
1343
|
+
|
1344
|
+
|
1345
|
+
|
1346
|
+
|
1347
|
+
</h3><div class="docstring">
|
1348
|
+
<div class="discussion">
|
1349
|
+
<div class="note abstract">
|
1350
|
+
<strong>This method is abstract.</strong>
|
1351
|
+
<div class='inline'></div>
|
1352
|
+
</div>
|
1353
|
+
|
1354
|
+
|
1355
|
+
</div>
|
1356
|
+
</div>
|
1357
|
+
<div class="tags">
|
1358
|
+
<p class="tag_title">Parameters:</p>
|
1359
|
+
<ul class="param">
|
1360
|
+
|
1361
|
+
<li>
|
1362
|
+
|
1363
|
+
<span class='name'>block</span>
|
1364
|
+
|
1365
|
+
|
1366
|
+
<span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]).returns(<span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)])</tt>)</span>
|
1367
|
+
|
1368
|
+
|
1369
|
+
|
1370
|
+
</li>
|
1371
|
+
|
1372
|
+
</ul>
|
1373
|
+
|
1374
|
+
<p class="tag_title">Returns:</p>
|
1375
|
+
<ul class="return">
|
1376
|
+
|
1377
|
+
<li>
|
372
1378
|
|
373
|
-
|
1379
|
+
|
1380
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)]</tt>)</span>
|
1381
|
+
|
1382
|
+
|
1383
|
+
|
1384
|
+
</li>
|
374
1385
|
|
1386
|
+
</ul>
|
375
1387
|
|
1388
|
+
</div><table class="source_code">
|
1389
|
+
<tr>
|
1390
|
+
<td>
|
1391
|
+
<pre class="lines">
|
376
1392
|
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
1393
|
|
382
|
-
|
383
|
-
|
1394
|
+
40</pre>
|
1395
|
+
</td>
|
1396
|
+
<td>
|
1397
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 40</span>
|
384
1398
|
|
1399
|
+
<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><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
1400
|
+
</td>
|
1401
|
+
</tr>
|
1402
|
+
</table>
|
1403
|
+
</div>
|
385
1404
|
|
386
|
-
<div class="method_details
|
387
|
-
<h3 class="signature
|
1405
|
+
<div class="method_details ">
|
1406
|
+
<h3 class="signature " id="map_err-instance_method">
|
388
1407
|
|
389
|
-
|
1408
|
+
#<strong>map_err</strong>(&block) ⇒ <tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)]</tt>
|
390
1409
|
|
391
1410
|
|
392
1411
|
|
@@ -394,7 +1413,11 @@
|
|
394
1413
|
|
395
1414
|
</h3><div class="docstring">
|
396
1415
|
<div class="discussion">
|
397
|
-
|
1416
|
+
<div class="note abstract">
|
1417
|
+
<strong>This method is abstract.</strong>
|
1418
|
+
<div class='inline'></div>
|
1419
|
+
</div>
|
1420
|
+
|
398
1421
|
|
399
1422
|
</div>
|
400
1423
|
</div>
|
@@ -404,10 +1427,10 @@
|
|
404
1427
|
|
405
1428
|
<li>
|
406
1429
|
|
407
|
-
<span class='name'>
|
1430
|
+
<span class='name'>block</span>
|
408
1431
|
|
409
1432
|
|
410
|
-
<span class='type'>(<tt>
|
1433
|
+
<span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>).returns(T.type_parameter(:NewErrType))</tt>)</span>
|
411
1434
|
|
412
1435
|
|
413
1436
|
|
@@ -421,7 +1444,7 @@
|
|
421
1444
|
<li>
|
422
1445
|
|
423
1446
|
|
424
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>,
|
1447
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)]</tt>)</span>
|
425
1448
|
|
426
1449
|
|
427
1450
|
|
@@ -435,47 +1458,21 @@
|
|
435
1458
|
<pre class="lines">
|
436
1459
|
|
437
1460
|
|
438
|
-
|
439
|
-
54
|
440
|
-
55
|
441
|
-
56
|
442
|
-
57
|
443
|
-
58
|
444
|
-
59
|
445
|
-
60
|
446
|
-
61
|
447
|
-
62
|
448
|
-
63</pre>
|
1461
|
+
52</pre>
|
449
1462
|
</td>
|
450
1463
|
<td>
|
451
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1464
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 52</span>
|
452
1465
|
|
453
|
-
<span class='kw'>def</span> <span class='id identifier
|
454
|
-
<span class='id identifier rubyid_errs'>errs</span> <span class='op'>=</span> <span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_filter'>filter</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:err?</span><span class='rparen'>)</span>
|
455
|
-
|
456
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_errs'>errs</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
457
|
-
<span class='comment'># This is safe as errs is empty.
|
458
|
-
</span> <span class='const'><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Result/Ok.html" title="Mangrove::Result::Ok (class)">Ok</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Result/Ok.html#initialize-instance_method" title="Mangrove::Result::Ok#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_r'>r</span><span class='op'>|</span> <span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='id identifier rubyid_r'>r</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Result/Ok.html" title="Mangrove::Result::Ok (class)">Ok</a></span></span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_ok_inner'>ok_inner</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
|
459
|
-
<span class='kw'>else</span>
|
460
|
-
<span class='comment'># This is safe as errs is results where err? is true
|
461
|
-
</span> <span class='const'><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Result/Err.html" title="Mangrove::Result::Err (class)">Err</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Result/Err.html#initialize-instance_method" title="Mangrove::Result::Err#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_errs'>errs</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_r'>r</span><span class='op'>|</span> <span class='const'>T</span><span class='period'>.</span><span class='id identifier rubyid_cast'>cast</span><span class='lparen'>(</span><span class='id identifier rubyid_r'>r</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Result/Err.html" 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::OkType (constant)">OkType</a></span></span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span></span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_err_inner'>err_inner</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
|
462
|
-
<span class='kw'>end</span>
|
463
|
-
<span class='kw'>end</span></pre>
|
1466
|
+
<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><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
464
1467
|
</td>
|
465
1468
|
</tr>
|
466
1469
|
</table>
|
467
1470
|
</div>
|
468
1471
|
|
469
|
-
|
470
|
-
|
471
|
-
<div id="instance_method_details" class="method_details_list">
|
472
|
-
<h2>Instance Method Details</h2>
|
473
|
-
|
474
|
-
|
475
|
-
<div class="method_details first">
|
476
|
-
<h3 class="signature first" id="==-instance_method">
|
1472
|
+
<div class="method_details ">
|
1473
|
+
<h3 class="signature " id="map_err_wt-instance_method">
|
477
1474
|
|
478
|
-
#<strong
|
1475
|
+
#<strong>map_err_wt</strong>(_t_new_err, &block) ⇒ <tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)]</tt>
|
479
1476
|
|
480
1477
|
|
481
1478
|
|
@@ -497,10 +1494,21 @@
|
|
497
1494
|
|
498
1495
|
<li>
|
499
1496
|
|
500
|
-
<span class='name'>
|
1497
|
+
<span class='name'>_t_new_err</span>
|
501
1498
|
|
502
1499
|
|
503
|
-
<span class='type'>(<tt>
|
1500
|
+
<span class='type'>(<tt>T::Class[T.type_parameter(:NewErrType)]</tt>)</span>
|
1501
|
+
|
1502
|
+
|
1503
|
+
|
1504
|
+
</li>
|
1505
|
+
|
1506
|
+
<li>
|
1507
|
+
|
1508
|
+
<span class='name'>block</span>
|
1509
|
+
|
1510
|
+
|
1511
|
+
<span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>).returns(T.type_parameter(:NewErrType))</tt>)</span>
|
504
1512
|
|
505
1513
|
|
506
1514
|
|
@@ -514,7 +1522,7 @@
|
|
514
1522
|
<li>
|
515
1523
|
|
516
1524
|
|
517
|
-
<span class='type'>(<tt>
|
1525
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)]</tt>)</span>
|
518
1526
|
|
519
1527
|
|
520
1528
|
|
@@ -528,21 +1536,21 @@
|
|
528
1536
|
<pre class="lines">
|
529
1537
|
|
530
1538
|
|
531
|
-
|
1539
|
+
55</pre>
|
532
1540
|
</td>
|
533
1541
|
<td>
|
534
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1542
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 55</span>
|
535
1543
|
|
536
|
-
<span class='kw'>def</span> <span class='
|
1544
|
+
<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><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
537
1545
|
</td>
|
538
1546
|
</tr>
|
539
1547
|
</table>
|
540
1548
|
</div>
|
541
1549
|
|
542
1550
|
<div class="method_details ">
|
543
|
-
<h3 class="signature " id="
|
1551
|
+
<h3 class="signature " id="map_ok-instance_method">
|
544
1552
|
|
545
|
-
#<strong>
|
1553
|
+
#<strong>map_ok</strong>(&block) ⇒ <tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>
|
546
1554
|
|
547
1555
|
|
548
1556
|
|
@@ -559,14 +1567,29 @@
|
|
559
1567
|
</div>
|
560
1568
|
</div>
|
561
1569
|
<div class="tags">
|
1570
|
+
<p class="tag_title">Parameters:</p>
|
1571
|
+
<ul class="param">
|
1572
|
+
|
1573
|
+
<li>
|
1574
|
+
|
1575
|
+
<span class='name'>block</span>
|
1576
|
+
|
1577
|
+
|
1578
|
+
<span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>).returns(T.type_parameter(:NewOkType))</tt>)</span>
|
1579
|
+
|
1580
|
+
|
1581
|
+
|
1582
|
+
</li>
|
562
1583
|
|
1584
|
+
</ul>
|
1585
|
+
|
563
1586
|
<p class="tag_title">Returns:</p>
|
564
1587
|
<ul class="return">
|
565
1588
|
|
566
1589
|
<li>
|
567
1590
|
|
568
1591
|
|
569
|
-
<span class='type'>(<tt>
|
1592
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>)</span>
|
570
1593
|
|
571
1594
|
|
572
1595
|
|
@@ -580,21 +1603,21 @@
|
|
580
1603
|
<pre class="lines">
|
581
1604
|
|
582
1605
|
|
583
|
-
|
1606
|
+
46</pre>
|
584
1607
|
</td>
|
585
1608
|
<td>
|
586
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1609
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 46</span>
|
587
1610
|
|
588
|
-
<span class='kw'>def</span> <span class='id identifier
|
1611
|
+
<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><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
589
1612
|
</td>
|
590
1613
|
</tr>
|
591
1614
|
</table>
|
592
1615
|
</div>
|
593
1616
|
|
594
1617
|
<div class="method_details ">
|
595
|
-
<h3 class="signature " id="
|
1618
|
+
<h3 class="signature " id="map_ok_wt-instance_method">
|
596
1619
|
|
597
|
-
#<strong>
|
1620
|
+
#<strong>map_ok_wt</strong>(_t_new_ok, &block) ⇒ <tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>
|
598
1621
|
|
599
1622
|
|
600
1623
|
|
@@ -616,10 +1639,21 @@
|
|
616
1639
|
|
617
1640
|
<li>
|
618
1641
|
|
619
|
-
<span class='name'>
|
1642
|
+
<span class='name'>_t_new_ok</span>
|
620
1643
|
|
621
1644
|
|
622
|
-
<span class='type'>(<tt>
|
1645
|
+
<span class='type'>(<tt>T::Class[T.type_parameter(:NewOkType)]</tt>)</span>
|
1646
|
+
|
1647
|
+
|
1648
|
+
|
1649
|
+
</li>
|
1650
|
+
|
1651
|
+
<li>
|
1652
|
+
|
1653
|
+
<span class='name'>block</span>
|
1654
|
+
|
1655
|
+
|
1656
|
+
<span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>).returns(T.type_parameter(:NewOkType))</tt>)</span>
|
623
1657
|
|
624
1658
|
|
625
1659
|
|
@@ -633,7 +1667,7 @@
|
|
633
1667
|
<li>
|
634
1668
|
|
635
1669
|
|
636
|
-
<span class='type'>(<tt><span class='object_link'><a href="#
|
1670
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>)</span>
|
637
1671
|
|
638
1672
|
|
639
1673
|
|
@@ -647,21 +1681,21 @@
|
|
647
1681
|
<pre class="lines">
|
648
1682
|
|
649
1683
|
|
650
|
-
|
1684
|
+
49</pre>
|
651
1685
|
</td>
|
652
1686
|
<td>
|
653
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1687
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 49</span>
|
654
1688
|
|
655
|
-
<span class='kw'>def</span> <span class='id identifier
|
1689
|
+
<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><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
656
1690
|
</td>
|
657
1691
|
</tr>
|
658
1692
|
</table>
|
659
1693
|
</div>
|
660
1694
|
|
661
1695
|
<div class="method_details ">
|
662
|
-
<h3 class="signature " id="
|
1696
|
+
<h3 class="signature " id="map_wt-instance_method">
|
663
1697
|
|
664
|
-
#<strong>
|
1698
|
+
#<strong>map_wt</strong>(_t_new_ok, _t_new_err, &block) ⇒ <tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)]</tt>
|
665
1699
|
|
666
1700
|
|
667
1701
|
|
@@ -681,12 +1715,34 @@
|
|
681
1715
|
<p class="tag_title">Parameters:</p>
|
682
1716
|
<ul class="param">
|
683
1717
|
|
1718
|
+
<li>
|
1719
|
+
|
1720
|
+
<span class='name'>_t_new_ok</span>
|
1721
|
+
|
1722
|
+
|
1723
|
+
<span class='type'>(<tt>T.type_parameter(:NewOkType)</tt>)</span>
|
1724
|
+
|
1725
|
+
|
1726
|
+
|
1727
|
+
</li>
|
1728
|
+
|
1729
|
+
<li>
|
1730
|
+
|
1731
|
+
<span class='name'>_t_new_err</span>
|
1732
|
+
|
1733
|
+
|
1734
|
+
<span class='type'>(<tt>T.type_parameter(:NewErrType)</tt>)</span>
|
1735
|
+
|
1736
|
+
|
1737
|
+
|
1738
|
+
</li>
|
1739
|
+
|
684
1740
|
<li>
|
685
1741
|
|
686
1742
|
<span class='name'>block</span>
|
687
1743
|
|
688
1744
|
|
689
|
-
<span class='type'>(<tt>T.proc.returns(T.
|
1745
|
+
<span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]).returns(<span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)])</tt>)</span>
|
690
1746
|
|
691
1747
|
|
692
1748
|
|
@@ -700,7 +1756,7 @@
|
|
700
1756
|
<li>
|
701
1757
|
|
702
1758
|
|
703
|
-
<span class='type'>(<tt><span class='object_link'><a href="
|
1759
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[T.type_parameter(:NewOkType), T.type_parameter(:NewErrType)]</tt>)</span>
|
704
1760
|
|
705
1761
|
|
706
1762
|
|
@@ -714,21 +1770,73 @@
|
|
714
1770
|
<pre class="lines">
|
715
1771
|
|
716
1772
|
|
717
|
-
|
1773
|
+
43</pre>
|
718
1774
|
</td>
|
719
1775
|
<td>
|
720
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1776
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 43</span>
|
721
1777
|
|
722
|
-
<span class='kw'>def</span> <span class='id identifier
|
1778
|
+
<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><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
723
1779
|
</td>
|
724
1780
|
</tr>
|
725
1781
|
</table>
|
726
1782
|
</div>
|
727
1783
|
|
728
1784
|
<div class="method_details ">
|
729
|
-
<h3 class="signature " id="
|
1785
|
+
<h3 class="signature " id="ok?-instance_method">
|
730
1786
|
|
731
|
-
#<strong>
|
1787
|
+
#<strong>ok?</strong> ⇒ <tt>Boolean</tt>
|
1788
|
+
|
1789
|
+
|
1790
|
+
|
1791
|
+
|
1792
|
+
|
1793
|
+
</h3><div class="docstring">
|
1794
|
+
<div class="discussion">
|
1795
|
+
<div class="note abstract">
|
1796
|
+
<strong>This method is abstract.</strong>
|
1797
|
+
<div class='inline'></div>
|
1798
|
+
</div>
|
1799
|
+
|
1800
|
+
|
1801
|
+
</div>
|
1802
|
+
</div>
|
1803
|
+
<div class="tags">
|
1804
|
+
|
1805
|
+
<p class="tag_title">Returns:</p>
|
1806
|
+
<ul class="return">
|
1807
|
+
|
1808
|
+
<li>
|
1809
|
+
|
1810
|
+
|
1811
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1812
|
+
|
1813
|
+
|
1814
|
+
|
1815
|
+
</li>
|
1816
|
+
|
1817
|
+
</ul>
|
1818
|
+
|
1819
|
+
</div><table class="source_code">
|
1820
|
+
<tr>
|
1821
|
+
<td>
|
1822
|
+
<pre class="lines">
|
1823
|
+
|
1824
|
+
|
1825
|
+
25</pre>
|
1826
|
+
</td>
|
1827
|
+
<td>
|
1828
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 25</span>
|
1829
|
+
|
1830
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_ok?'>ok?</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
1831
|
+
</td>
|
1832
|
+
</tr>
|
1833
|
+
</table>
|
1834
|
+
</div>
|
1835
|
+
|
1836
|
+
<div class="method_details ">
|
1837
|
+
<h3 class="signature " id="or-instance_method">
|
1838
|
+
|
1839
|
+
#<strong>or</strong>(other) ⇒ <tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>
|
732
1840
|
|
733
1841
|
|
734
1842
|
|
@@ -750,10 +1858,10 @@
|
|
750
1858
|
|
751
1859
|
<li>
|
752
1860
|
|
753
|
-
<span class='name'>
|
1861
|
+
<span class='name'>other</span>
|
754
1862
|
|
755
1863
|
|
756
|
-
<span class='type'>(<tt
|
1864
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>)</span>
|
757
1865
|
|
758
1866
|
|
759
1867
|
|
@@ -767,7 +1875,7 @@
|
|
767
1875
|
<li>
|
768
1876
|
|
769
1877
|
|
770
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>,
|
1878
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>]</tt>)</span>
|
771
1879
|
|
772
1880
|
|
773
1881
|
|
@@ -781,21 +1889,21 @@
|
|
781
1889
|
<pre class="lines">
|
782
1890
|
|
783
1891
|
|
784
|
-
|
1892
|
+
67</pre>
|
785
1893
|
</td>
|
786
1894
|
<td>
|
787
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1895
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 67</span>
|
788
1896
|
|
789
|
-
<span class='kw'>def</span> <span class='
|
1897
|
+
<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><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
790
1898
|
</td>
|
791
1899
|
</tr>
|
792
1900
|
</table>
|
793
1901
|
</div>
|
794
1902
|
|
795
1903
|
<div class="method_details ">
|
796
|
-
<h3 class="signature " id="
|
1904
|
+
<h3 class="signature " id="or_else-instance_method">
|
797
1905
|
|
798
|
-
#<strong>
|
1906
|
+
#<strong>or_else</strong>(&block) ⇒ <tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)]</tt>
|
799
1907
|
|
800
1908
|
|
801
1909
|
|
@@ -820,7 +1928,7 @@
|
|
820
1928
|
<span class='name'>block</span>
|
821
1929
|
|
822
1930
|
|
823
|
-
<span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#
|
1931
|
+
<span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>).returns(<span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)])</tt>)</span>
|
824
1932
|
|
825
1933
|
|
826
1934
|
|
@@ -834,7 +1942,7 @@
|
|
834
1942
|
<li>
|
835
1943
|
|
836
1944
|
|
837
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[
|
1945
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)]</tt>)</span>
|
838
1946
|
|
839
1947
|
|
840
1948
|
|
@@ -848,21 +1956,21 @@
|
|
848
1956
|
<pre class="lines">
|
849
1957
|
|
850
1958
|
|
851
|
-
|
1959
|
+
70</pre>
|
852
1960
|
</td>
|
853
1961
|
<td>
|
854
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
1962
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 70</span>
|
855
1963
|
|
856
|
-
<span class='kw'>def</span> <span class='id identifier
|
1964
|
+
<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><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
857
1965
|
</td>
|
858
1966
|
</tr>
|
859
1967
|
</table>
|
860
1968
|
</div>
|
861
1969
|
|
862
1970
|
<div class="method_details ">
|
863
|
-
<h3 class="signature " id="
|
1971
|
+
<h3 class="signature " id="or_else_wt-instance_method">
|
864
1972
|
|
865
|
-
#<strong>
|
1973
|
+
#<strong>or_else_wt</strong>(_t_new_err, &block) ⇒ <tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)]</tt>
|
866
1974
|
|
867
1975
|
|
868
1976
|
|
@@ -879,14 +1987,40 @@
|
|
879
1987
|
</div>
|
880
1988
|
</div>
|
881
1989
|
<div class="tags">
|
1990
|
+
<p class="tag_title">Parameters:</p>
|
1991
|
+
<ul class="param">
|
1992
|
+
|
1993
|
+
<li>
|
1994
|
+
|
1995
|
+
<span class='name'>_t_new_err</span>
|
1996
|
+
|
1997
|
+
|
1998
|
+
<span class='type'>(<tt>T::Class[T.type_parameter(:NewErrType)]</tt>)</span>
|
1999
|
+
|
2000
|
+
|
2001
|
+
|
2002
|
+
</li>
|
2003
|
+
|
2004
|
+
<li>
|
2005
|
+
|
2006
|
+
<span class='name'>block</span>
|
2007
|
+
|
2008
|
+
|
2009
|
+
<span class='type'>(<tt>T.proc.params(this: <span class='object_link'><a href="#ErrType-constant" title="Mangrove::Result::ErrType (constant)">ErrType</a></span>).returns(<span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)])</tt>)</span>
|
2010
|
+
|
2011
|
+
|
2012
|
+
|
2013
|
+
</li>
|
882
2014
|
|
2015
|
+
</ul>
|
2016
|
+
|
883
2017
|
<p class="tag_title">Returns:</p>
|
884
2018
|
<ul class="return">
|
885
2019
|
|
886
2020
|
<li>
|
887
2021
|
|
888
2022
|
|
889
|
-
<span class='type'>(<tt>
|
2023
|
+
<span class='type'>(<tt><span class='object_link'><a href="" title="Mangrove::Result (module)">Result</a></span>[<span class='object_link'><a href="#OkType-constant" title="Mangrove::Result::OkType (constant)">OkType</a></span>, T.type_parameter(:NewErrType)]</tt>)</span>
|
890
2024
|
|
891
2025
|
|
892
2026
|
|
@@ -900,12 +2034,12 @@
|
|
900
2034
|
<pre class="lines">
|
901
2035
|
|
902
2036
|
|
903
|
-
|
2037
|
+
73</pre>
|
904
2038
|
</td>
|
905
2039
|
<td>
|
906
|
-
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line
|
2040
|
+
<pre class="code"><span class="info file"># File 'lib/mangrove/result.rb', line 73</span>
|
907
2041
|
|
908
|
-
<span class='kw'>def</span> <span class='id identifier
|
2042
|
+
<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><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
909
2043
|
</td>
|
910
2044
|
</tr>
|
911
2045
|
</table>
|
@@ -968,7 +2102,7 @@
|
|
968
2102
|
</div>
|
969
2103
|
|
970
2104
|
<div id="footer">
|
971
|
-
Generated on
|
2105
|
+
Generated on Thu Oct 26 12:34:21 2023 by
|
972
2106
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
973
2107
|
0.9.34 (ruby-3.1.2).
|
974
2108
|
</div>
|