mangrove 0.5.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d918f24a3f566f944a31d9eac30ab5f4924c69260ac95977cca466fb758f32fa
4
- data.tar.gz: 6a2f8b8dc58cbb9a3b51d79834cd0a342671dbc5c4d870ae238bd756f6c2fe12
3
+ metadata.gz: ce10d6f80eaacb38bdfc0ad5d402bd06bb0e0b53c9d5d430485ec9e6bc37c03f
4
+ data.tar.gz: eaa53b1c71f5996c07fc62157474ec82c0d614e7b8e7b45d24d6f69480d3fafe
5
5
  SHA512:
6
- metadata.gz: fc901c133dd8b64466ab1f5a900f2469e17564cb5a7e7b7db13e3714f094dd400877ed214383500229d3e98d51c457427044df78afbc28a96b48fba29e6e91cb
7
- data.tar.gz: 890c8fbd972e5c2b87e6ffde50eda4b98c45105419fd43abac76644781bcb4f5dd8d2ee736877f2a4198c0a068a0b2732a89fb40c5607ced5fc5ac7897208ed6
6
+ metadata.gz: c8dd5d19669b8f3537e508565016cd5336d3cdfbdaf77674d011db162f539702edeceb3dee57c6a6b8b7ec32cfc389dbdff0ce6d7eed62ac0fba2c7f2ca62ba0
7
+ data.tar.gz: a6f1347477b437df4c197ebcf07585f8f8315ff68a75939316c907b286d029c58fe09b173034fcc33a52192452fb8e38c27a847dba097ee28a64da95f2059a44
data/README.md CHANGED
@@ -35,9 +35,7 @@ Other examples are available at [`spec/**/**_spec.rb`](https://github.com/kazzix
35
35
  Most features are not implemented.
36
36
 
37
37
  - [x] Option Type (Partially Implemented)
38
- - [x] Auto propagation like Rust's `?` (formerly `try!`)
39
38
  - [x] Result Type (Partially Implemented)
40
- - [x] Auto propagation like Rust's `?` (formerly `try!`)
41
39
  - [ ] Builder type (Not implemented)
42
40
  - [ ] Auto Implementation
43
41
  - [ ] TODO
@@ -213,7 +213,7 @@
213
213
  </div>
214
214
 
215
215
  <div id="footer">
216
- Generated on Thu Aug 31 15:04:25 2023 by
216
+ Generated on Tue Sep 12 17:35:09 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>
@@ -553,7 +553,7 @@
553
553
  </div>
554
554
 
555
555
  <div id="footer">
556
- Generated on Thu Aug 31 15:04:25 2023 by
556
+ Generated on Fri Sep 1 17:32:57 2023 by
557
557
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
558
558
  0.9.34 (ruby-3.2.2).
559
559
  </div>
@@ -129,7 +129,7 @@
129
129
  </div>
130
130
 
131
131
  <div id="footer">
132
- Generated on Thu Aug 31 15:04:25 2023 by
132
+ Generated on Fri Sep 1 17:32:57 2023 by
133
133
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
134
134
  0.9.34 (ruby-3.2.2).
135
135
  </div>
@@ -321,7 +321,7 @@
321
321
  </div>
322
322
 
323
323
  <div id="footer">
324
- Generated on Thu Aug 31 15:04:26 2023 by
324
+ Generated on Tue Sep 12 17:35:09 2023 by
325
325
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
326
326
  0.9.34 (ruby-3.2.2).
327
327
  </div>
@@ -83,29 +83,18 @@
83
83
 
84
84
  <dl>
85
85
  <dt>Defined in:</dt>
86
- <dd>lib/mangrove/control_flow.rb<span class="defines">,<br />
87
- lib/mangrove/control_flow/rewriter.rb,<br /> lib/mangrove/control_flow/control_signal.rb</span>
86
+ <dd>lib/mangrove/control_flow/rewriter.rb<span class="defines">,<br />
87
+ lib/mangrove/control_flow/control_signal.rb</span>
88
88
  </dd>
89
89
  </dl>
90
90
 
91
91
  </div>
92
92
 
93
- <h2>Overview</h2><div class="docstring">
94
- <div class="discussion">
95
-
96
- <p>Mangrove::ControlFlow</p>
97
-
98
-
99
- </div>
100
- </div>
101
- <div class="tags">
102
-
103
-
104
- </div><h2>Defined Under Namespace</h2>
93
+ <h2>Defined Under Namespace</h2>
105
94
  <p class="children">
106
95
 
107
96
 
108
- <strong class="modules">Modules:</strong> <span class='object_link'><a href="ControlFlow/ControlSignal.html" title="Mangrove::ControlFlow::ControlSignal (module)">ControlSignal</a></span>, <span class='object_link'><a href="ControlFlow/Handler.html" title="Mangrove::ControlFlow::Handler (module)">Handler</a></span>
97
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="ControlFlow/ControlSignal.html" title="Mangrove::ControlFlow::ControlSignal (module)">ControlSignal</a></span>
109
98
 
110
99
 
111
100
 
@@ -244,7 +233,7 @@
244
233
  </div>
245
234
 
246
235
  <div id="footer">
247
- Generated on Thu Aug 31 15:04:25 2023 by
236
+ Generated on Tue Sep 12 17:35:09 2023 by
248
237
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
249
238
  0.9.34 (ruby-3.2.2).
250
239
  </div>
@@ -424,7 +424,7 @@
424
424
  </div>
425
425
 
426
426
  <div id="footer">
427
- Generated on Thu Aug 31 15:04:26 2023 by
427
+ Generated on Tue Sep 12 17:35:09 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>
@@ -278,6 +278,28 @@
278
278
 
279
279
 
280
280
 
281
+ <span class="summary_desc"><div class='inline'></div></span>
282
+
283
+ </li>
284
+
285
+
286
+ <li class="public ">
287
+ <span class="summary_signature">
288
+
289
+ <a href="#transpose-instance_method" title="#transpose (instance method)">#<strong>transpose</strong>(err) &#x21d2; Mangrove::Result[InnerType, T.type_parameter(:ErrType)] </a>
290
+
291
+
292
+
293
+ </span>
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
281
303
  <span class="summary_desc"><div class='inline'></div></span>
282
304
 
283
305
  </li>
@@ -401,20 +423,20 @@
401
423
  <pre class="lines">
402
424
 
403
425
 
404
- 102
405
- 103
406
- 104
407
- 105
408
- 106
409
426
  107
410
427
  108
411
428
  109
412
429
  110
413
430
  111
414
- 112</pre>
431
+ 112
432
+ 113
433
+ 114
434
+ 115
435
+ 116
436
+ 117</pre>
415
437
  </td>
416
438
  <td>
417
- <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 102</span>
439
+ <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 107</span>
418
440
 
419
441
  <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>
420
442
  <span class='kw'>case</span> <span class='id identifier rubyid_other'>other</span>
@@ -497,12 +519,12 @@
497
519
  <pre class="lines">
498
520
 
499
521
 
500
- 125
501
- 126
502
- 127</pre>
522
+ 130
523
+ 131
524
+ 132</pre>
503
525
  </td>
504
526
  <td>
505
- <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 125</span>
527
+ <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 130</span>
506
528
 
507
529
  <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>
508
530
  <span class='id identifier rubyid_raise'>raise</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="ControlSignal.html" title="Mangrove::Option::ControlSignal (class)">ControlSignal</a></span></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="../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_message'>message</span><span class='rparen'>)</span>
@@ -564,12 +586,12 @@
564
586
  <pre class="lines">
565
587
 
566
588
 
567
- 141
568
- 142
569
- 143</pre>
589
+ 146
590
+ 147
591
+ 148</pre>
570
592
  </td>
571
593
  <td>
572
- <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 141</span>
594
+ <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 146</span>
573
595
 
574
596
  <span class='kw'>def</span> <span class='id identifier rubyid_map_none'>map_none</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
575
597
  <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
@@ -631,12 +653,12 @@
631
653
  <pre class="lines">
632
654
 
633
655
 
634
- 136
635
- 137
636
- 138</pre>
656
+ 141
657
+ 142
658
+ 143</pre>
637
659
  </td>
638
660
  <td>
639
- <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 136</span>
661
+ <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 141</span>
640
662
 
641
663
  <span class='kw'>def</span> <span class='id identifier rubyid_map_some'>map_some</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid__block'>_block</span><span class='rparen'>)</span>
642
664
  <span class='kw'>self</span>
@@ -683,10 +705,10 @@
683
705
  <pre class="lines">
684
706
 
685
707
 
686
- 133</pre>
708
+ 138</pre>
687
709
  </td>
688
710
  <td>
689
- <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 133</span>
711
+ <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 138</span>
690
712
 
691
713
  <span class='kw'>def</span> <span class='id identifier rubyid_none?'>none?</span> <span class='op'>=</span> <span class='kw'>true</span></pre>
692
714
  </td>
@@ -731,15 +753,82 @@
731
753
  <pre class="lines">
732
754
 
733
755
 
734
- 130</pre>
756
+ 135</pre>
735
757
  </td>
736
758
  <td>
737
- <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 130</span>
759
+ <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 135</span>
738
760
 
739
761
  <span class='kw'>def</span> <span class='id identifier rubyid_some?'>some?</span> <span class='op'>=</span> <span class='kw'>false</span></pre>
740
762
  </td>
741
763
  </tr>
742
764
  </table>
765
+ </div>
766
+
767
+ <div class="method_details ">
768
+ <h3 class="signature " id="transpose-instance_method">
769
+
770
+ #<strong>transpose</strong>(err) &#x21d2; <tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Mangrove::Result</a></span>[<span class='object_link'><a href="#InnerType-constant" title="Mangrove::Option::None::InnerType (constant)">InnerType</a></span>, T.type_parameter(:ErrType)]</tt>
771
+
772
+
773
+
774
+
775
+
776
+ </h3><div class="docstring">
777
+ <div class="discussion">
778
+
779
+
780
+ </div>
781
+ </div>
782
+ <div class="tags">
783
+ <p class="tag_title">Parameters:</p>
784
+ <ul class="param">
785
+
786
+ <li>
787
+
788
+ <span class='name'>err</span>
789
+
790
+
791
+ <span class='type'>(<tt>T.type_parameter(:ErrType)</tt>)</span>
792
+
793
+
794
+
795
+ </li>
796
+
797
+ </ul>
798
+
799
+ <p class="tag_title">Returns:</p>
800
+ <ul class="return">
801
+
802
+ <li>
803
+
804
+
805
+ <span class='type'>(<tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Mangrove::Result</a></span>[<span class='object_link'><a href="#InnerType-constant" title="Mangrove::Option::None::InnerType (constant)">InnerType</a></span>, T.type_parameter(:ErrType)]</tt>)</span>
806
+
807
+
808
+
809
+ </li>
810
+
811
+ </ul>
812
+
813
+ </div><table class="source_code">
814
+ <tr>
815
+ <td>
816
+ <pre class="lines">
817
+
818
+
819
+ 151
820
+ 152
821
+ 153</pre>
822
+ </td>
823
+ <td>
824
+ <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 151</span>
825
+
826
+ <span class='kw'>def</span> <span class='id identifier rubyid_transpose'>transpose</span><span class='lparen'>(</span><span class='id identifier rubyid_err'>err</span><span class='rparen'>)</span>
827
+ <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="../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_err'>err</span><span class='rparen'>)</span>
828
+ <span class='kw'>end</span></pre>
829
+ </td>
830
+ </tr>
831
+ </table>
743
832
  </div>
744
833
 
745
834
  <div class="method_details ">
@@ -792,12 +881,12 @@
792
881
  <pre class="lines">
793
882
 
794
883
 
795
- 120
796
- 121
797
- 122</pre>
884
+ 125
885
+ 126
886
+ 127</pre>
798
887
  </td>
799
888
  <td>
800
- <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 120</span>
889
+ <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 125</span>
801
890
 
802
891
  <span class='kw'>def</span> <span class='id identifier rubyid_unwrap!'>unwrap!</span>
803
892
  <span class='id identifier rubyid_raise'>raise</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="ControlSignal.html" title="Mangrove::Option::ControlSignal (class)">ControlSignal</a></span></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="../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='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>called `Option#unwrap!` on an `None` value: </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
@@ -859,12 +948,12 @@
859
948
  <pre class="lines">
860
949
 
861
950
 
862
- 115
863
- 116
864
- 117</pre>
951
+ 120
952
+ 121
953
+ 122</pre>
865
954
  </td>
866
955
  <td>
867
- <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 115</span>
956
+ <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 120</span>
868
957
 
869
958
  <span class='kw'>def</span> <span class='id identifier rubyid_unwrap_or'>unwrap_or</span><span class='lparen'>(</span><span class='id identifier rubyid_default'>default</span><span class='rparen'>)</span>
870
959
  <span class='id identifier rubyid_default'>default</span>
@@ -879,7 +968,7 @@
879
968
  </div>
880
969
 
881
970
  <div id="footer">
882
- Generated on Thu Aug 31 15:04:25 2023 by
971
+ Generated on Tue Sep 12 17:35:09 2023 by
883
972
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
884
973
  0.9.34 (ruby-3.2.2).
885
974
  </div>
@@ -302,6 +302,28 @@
302
302
 
303
303
 
304
304
 
305
+ <span class="summary_desc"><div class='inline'></div></span>
306
+
307
+ </li>
308
+
309
+
310
+ <li class="public ">
311
+ <span class="summary_signature">
312
+
313
+ <a href="#transpose-instance_method" title="#transpose (instance method)">#<strong>transpose</strong>(_err) &#x21d2; Mangrove::Result[InnerType, T.type_parameter(:ErrType)] </a>
314
+
315
+
316
+
317
+ </span>
318
+
319
+
320
+
321
+
322
+
323
+
324
+
325
+
326
+
305
327
  <span class="summary_desc"><div class='inline'></div></span>
306
328
 
307
329
  </li>
@@ -831,6 +853,73 @@
831
853
  </td>
832
854
  </tr>
833
855
  </table>
856
+ </div>
857
+
858
+ <div class="method_details ">
859
+ <h3 class="signature " id="transpose-instance_method">
860
+
861
+ #<strong>transpose</strong>(_err) &#x21d2; <tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Mangrove::Result</a></span>[<span class='object_link'><a href="#InnerType-constant" title="Mangrove::Option::Some::InnerType (constant)">InnerType</a></span>, T.type_parameter(:ErrType)]</tt>
862
+
863
+
864
+
865
+
866
+
867
+ </h3><div class="docstring">
868
+ <div class="discussion">
869
+
870
+
871
+ </div>
872
+ </div>
873
+ <div class="tags">
874
+ <p class="tag_title">Parameters:</p>
875
+ <ul class="param">
876
+
877
+ <li>
878
+
879
+ <span class='name'>_err</span>
880
+
881
+
882
+ <span class='type'>(<tt>T.type_parameter(:ErrType)</tt>)</span>
883
+
884
+
885
+
886
+ </li>
887
+
888
+ </ul>
889
+
890
+ <p class="tag_title">Returns:</p>
891
+ <ul class="return">
892
+
893
+ <li>
894
+
895
+
896
+ <span class='type'>(<tt><span class='object_link'><a href="../Result.html" title="Mangrove::Result (module)">Mangrove::Result</a></span>[<span class='object_link'><a href="#InnerType-constant" title="Mangrove::Option::Some::InnerType (constant)">InnerType</a></span>, T.type_parameter(:ErrType)]</tt>)</span>
897
+
898
+
899
+
900
+ </li>
901
+
902
+ </ul>
903
+
904
+ </div><table class="source_code">
905
+ <tr>
906
+ <td>
907
+ <pre class="lines">
908
+
909
+
910
+ 86
911
+ 87
912
+ 88</pre>
913
+ </td>
914
+ <td>
915
+ <pre class="code"><span class="info file"># File 'lib/mangrove/option.rb', line 86</span>
916
+
917
+ <span class='kw'>def</span> <span class='id identifier rubyid_transpose'>transpose</span><span class='lparen'>(</span><span class='id identifier rubyid__err'>_err</span><span class='rparen'>)</span>
918
+ <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="../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='ivar'>@inner</span><span class='rparen'>)</span>
919
+ <span class='kw'>end</span></pre>
920
+ </td>
921
+ </tr>
922
+ </table>
834
923
  </div>
835
924
 
836
925
  <div class="method_details ">
@@ -1009,7 +1098,7 @@
1009
1098
  </div>
1010
1099
 
1011
1100
  <div id="footer">
1012
- Generated on Thu Aug 31 15:04:25 2023 by
1101
+ Generated on Tue Sep 12 17:35:09 2023 by
1013
1102
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1014
1103
  0.9.34 (ruby-3.2.2).
1015
1104
  </div>