mangrove 0.10.1 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -318,48 +318,48 @@
318
318
 
319
319
  <li class="odd ">
320
320
  <div class="item">
321
- <span class='object_link'><a href="Mangrove/Result.html#map_err-instance_method" title="Mangrove::Result#map_err (method)">#map_err</a></span>
322
- <small>Mangrove::Result</small>
321
+ <span class='object_link'><a href="Mangrove/Option/Some.html#map-instance_method" title="Mangrove::Option::Some#map (method)">#map</a></span>
322
+ <small>Mangrove::Option::Some</small>
323
323
  </div>
324
324
  </li>
325
325
 
326
326
 
327
327
  <li class="even ">
328
328
  <div class="item">
329
- <span class='object_link'><a href="Mangrove/Result/Ok.html#map_err-instance_method" title="Mangrove::Result::Ok#map_err (method)">#map_err</a></span>
330
- <small>Mangrove::Result::Ok</small>
329
+ <span class='object_link'><a href="Mangrove/Option/None.html#map-instance_method" title="Mangrove::Option::None#map (method)">#map</a></span>
330
+ <small>Mangrove::Option::None</small>
331
331
  </div>
332
332
  </li>
333
333
 
334
334
 
335
335
  <li class="odd ">
336
336
  <div class="item">
337
- <span class='object_link'><a href="Mangrove/Result/Err.html#map_err-instance_method" title="Mangrove::Result::Err#map_err (method)">#map_err</a></span>
338
- <small>Mangrove::Result::Err</small>
337
+ <span class='object_link'><a href="Mangrove/Option.html#map-instance_method" title="Mangrove::Option#map (method)">#map</a></span>
338
+ <small>Mangrove::Option</small>
339
339
  </div>
340
340
  </li>
341
341
 
342
342
 
343
343
  <li class="even ">
344
344
  <div class="item">
345
- <span class='object_link'><a href="Mangrove/Option/Some.html#map_none-instance_method" title="Mangrove::Option::Some#map_none (method)">#map_none</a></span>
346
- <small>Mangrove::Option::Some</small>
345
+ <span class='object_link'><a href="Mangrove/Result.html#map_err-instance_method" title="Mangrove::Result#map_err (method)">#map_err</a></span>
346
+ <small>Mangrove::Result</small>
347
347
  </div>
348
348
  </li>
349
349
 
350
350
 
351
351
  <li class="odd ">
352
352
  <div class="item">
353
- <span class='object_link'><a href="Mangrove/Option/None.html#map_none-instance_method" title="Mangrove::Option::None#map_none (method)">#map_none</a></span>
354
- <small>Mangrove::Option::None</small>
353
+ <span class='object_link'><a href="Mangrove/Result/Ok.html#map_err-instance_method" title="Mangrove::Result::Ok#map_err (method)">#map_err</a></span>
354
+ <small>Mangrove::Result::Ok</small>
355
355
  </div>
356
356
  </li>
357
357
 
358
358
 
359
359
  <li class="even ">
360
360
  <div class="item">
361
- <span class='object_link'><a href="Mangrove/Option.html#map_none-instance_method" title="Mangrove::Option#map_none (method)">#map_none</a></span>
362
- <small>Mangrove::Option</small>
361
+ <span class='object_link'><a href="Mangrove/Result/Err.html#map_err-instance_method" title="Mangrove::Result::Err#map_err (method)">#map_err</a></span>
362
+ <small>Mangrove::Result::Err</small>
363
363
  </div>
364
364
  </li>
365
365
 
@@ -390,7 +390,7 @@
390
390
 
391
391
  <li class="even ">
392
392
  <div class="item">
393
- <span class='object_link'><a href="Mangrove/Option/Some.html#map_some-instance_method" title="Mangrove::Option::Some#map_some (method)">#map_some</a></span>
393
+ <span class='object_link'><a href="Mangrove/Option/Some.html#none%3F-instance_method" title="Mangrove::Option::Some#none? (method)">#none?</a></span>
394
394
  <small>Mangrove::Option::Some</small>
395
395
  </div>
396
396
  </li>
@@ -398,7 +398,7 @@
398
398
 
399
399
  <li class="odd ">
400
400
  <div class="item">
401
- <span class='object_link'><a href="Mangrove/Option/None.html#map_some-instance_method" title="Mangrove::Option::None#map_some (method)">#map_some</a></span>
401
+ <span class='object_link'><a href="Mangrove/Option/None.html#none%3F-instance_method" title="Mangrove::Option::None#none? (method)">#none?</a></span>
402
402
  <small>Mangrove::Option::None</small>
403
403
  </div>
404
404
  </li>
@@ -406,7 +406,7 @@
406
406
 
407
407
  <li class="even ">
408
408
  <div class="item">
409
- <span class='object_link'><a href="Mangrove/Option.html#map_some-instance_method" title="Mangrove::Option#map_some (method)">#map_some</a></span>
409
+ <span class='object_link'><a href="Mangrove/Option.html#none%3F-instance_method" title="Mangrove::Option#none? (method)">#none?</a></span>
410
410
  <small>Mangrove::Option</small>
411
411
  </div>
412
412
  </li>
@@ -414,56 +414,56 @@
414
414
 
415
415
  <li class="odd ">
416
416
  <div class="item">
417
- <span class='object_link'><a href="Mangrove/Option/Some.html#none%3F-instance_method" title="Mangrove::Option::Some#none? (method)">#none?</a></span>
418
- <small>Mangrove::Option::Some</small>
417
+ <span class='object_link'><a href="Mangrove/Result.html#ok%3F-instance_method" title="Mangrove::Result#ok? (method)">#ok?</a></span>
418
+ <small>Mangrove::Result</small>
419
419
  </div>
420
420
  </li>
421
421
 
422
422
 
423
423
  <li class="even ">
424
424
  <div class="item">
425
- <span class='object_link'><a href="Mangrove/Option/None.html#none%3F-instance_method" title="Mangrove::Option::None#none? (method)">#none?</a></span>
426
- <small>Mangrove::Option::None</small>
425
+ <span class='object_link'><a href="Mangrove/Result/Ok.html#ok%3F-instance_method" title="Mangrove::Result::Ok#ok? (method)">#ok?</a></span>
426
+ <small>Mangrove::Result::Ok</small>
427
427
  </div>
428
428
  </li>
429
429
 
430
430
 
431
431
  <li class="odd ">
432
432
  <div class="item">
433
- <span class='object_link'><a href="Mangrove/Option.html#none%3F-instance_method" title="Mangrove::Option#none? (method)">#none?</a></span>
434
- <small>Mangrove::Option</small>
433
+ <span class='object_link'><a href="Mangrove/Result/Err.html#ok%3F-instance_method" title="Mangrove::Result::Err#ok? (method)">#ok?</a></span>
434
+ <small>Mangrove::Result::Err</small>
435
435
  </div>
436
436
  </li>
437
437
 
438
438
 
439
439
  <li class="even ">
440
440
  <div class="item">
441
- <span class='object_link'><a href="Mangrove/Result.html#ok%3F-instance_method" title="Mangrove::Result#ok? (method)">#ok?</a></span>
442
- <small>Mangrove::Result</small>
441
+ <span class='object_link'><a href="Mangrove/Result/Ok.html#ok_inner-instance_method" title="Mangrove::Result::Ok#ok_inner (method)">#ok_inner</a></span>
442
+ <small>Mangrove::Result::Ok</small>
443
443
  </div>
444
444
  </li>
445
445
 
446
446
 
447
447
  <li class="odd ">
448
448
  <div class="item">
449
- <span class='object_link'><a href="Mangrove/Result/Ok.html#ok%3F-instance_method" title="Mangrove::Result::Ok#ok? (method)">#ok?</a></span>
450
- <small>Mangrove::Result::Ok</small>
449
+ <span class='object_link'><a href="Mangrove/Option/Some.html#or-instance_method" title="Mangrove::Option::Some#or (method)">#or</a></span>
450
+ <small>Mangrove::Option::Some</small>
451
451
  </div>
452
452
  </li>
453
453
 
454
454
 
455
455
  <li class="even ">
456
456
  <div class="item">
457
- <span class='object_link'><a href="Mangrove/Result/Err.html#ok%3F-instance_method" title="Mangrove::Result::Err#ok? (method)">#ok?</a></span>
458
- <small>Mangrove::Result::Err</small>
457
+ <span class='object_link'><a href="Mangrove/Option/None.html#or-instance_method" title="Mangrove::Option::None#or (method)">#or</a></span>
458
+ <small>Mangrove::Option::None</small>
459
459
  </div>
460
460
  </li>
461
461
 
462
462
 
463
463
  <li class="odd ">
464
464
  <div class="item">
465
- <span class='object_link'><a href="Mangrove/Result/Ok.html#ok_inner-instance_method" title="Mangrove::Result::Ok#ok_inner (method)">#ok_inner</a></span>
466
- <small>Mangrove::Result::Ok</small>
465
+ <span class='object_link'><a href="Mangrove/Option.html#or-instance_method" title="Mangrove::Option#or (method)">#or</a></span>
466
+ <small>Mangrove::Option</small>
467
467
  </div>
468
468
  </li>
469
469
 
@@ -100,7 +100,7 @@
100
100
  </div>
101
101
 
102
102
  <div id="footer">
103
- Generated on Tue Oct 24 12:55:36 2023 by
103
+ Generated on Tue Oct 24 20:44:48 2023 by
104
104
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
105
105
  0.9.34 (ruby-3.1.2).
106
106
  </div>
@@ -91,13 +91,13 @@ module Mangrove
91
91
  sig { override.returns(T::Boolean) }
92
92
  def none? = false
93
93
 
94
- sig { override.params(block: T.proc.params(inner: InnerType).returns(Option[InnerType])).returns(Option[InnerType]) }
95
- def map_some(&block)
94
+ sig { override.type_parameters(:NewInnerType).params(block: T.proc.params(inner: InnerType).returns(Option[T.type_parameter(:NewInnerType)])).returns(::Mangrove::Option[T.type_parameter(:NewInnerType)]) }
95
+ def map(&block)
96
96
  block.call(@inner)
97
97
  end
98
98
 
99
- sig { override.params(_block: T.proc.returns(Option[InnerType])).returns(Option::Some[InnerType]) }
100
- def map_none(&_block)
99
+ sig { override.params(_default: Option[InnerType]).returns(Option[InnerType]) }
100
+ def or(_default)
101
101
  self
102
102
  end
103
103
 
@@ -161,14 +161,14 @@ module Mangrove
161
161
  sig { override.returns(T::Boolean) }
162
162
  def none? = true
163
163
 
164
- sig { override.params(_block: T.proc.params(inner: InnerType).returns(Option[InnerType])).returns(Option::None[InnerType]) }
165
- def map_some(&_block)
166
- self
164
+ sig { override.type_parameters(:NewInnerType).params(_block: T.proc.params(inner: InnerType).returns(Option[T.type_parameter(:NewInnerType)])).returns(Option[T.type_parameter(:NewInnerType)]) }
165
+ def map(&_block)
166
+ T.cast(self, Option[T.type_parameter(:NewInnerType)])
167
167
  end
168
168
 
169
- sig { override.params(block: T.proc.returns(Option[InnerType])).returns(Option[InnerType]) }
170
- def map_none(&block)
171
- block.call
169
+ sig { override.params(default: Option[InnerType]).returns(Option[InnerType]) }
170
+ def or(default)
171
+ default
172
172
  end
173
173
 
174
174
  sig { override.type_parameters(:ErrType).params(err: T.type_parameter(:ErrType)).returns(Mangrove::Result[InnerType, T.type_parameter(:ErrType)]) }
@@ -198,11 +198,11 @@ module Mangrove
198
198
  sig { abstract.returns(T::Boolean) }
199
199
  def none?; end
200
200
 
201
- sig { abstract.params(block: T.proc.params(inner: InnerType).returns(Option[InnerType])).returns(Option[InnerType]) }
202
- def map_some(&block); end
201
+ sig { abstract.type_parameters(:NewInnerType).params(block: T.proc.params(inner: InnerType).returns(Option[T.type_parameter(:NewInnerType)])).returns(::Mangrove::Option[T.type_parameter(:NewInnerType)]) }
202
+ def map(&block); end
203
203
 
204
- sig { abstract.params(block: T.proc.returns(Option[InnerType])).returns(Option[InnerType]) }
205
- def map_none(&block); end
204
+ sig { abstract.params(default: Option[InnerType]).returns(Option[InnerType]) }
205
+ def or(default); end
206
206
 
207
207
  sig { abstract.type_parameters(:ErrType).params(err: T.type_parameter(:ErrType)).returns(Mangrove::Result[InnerType, T.type_parameter(:ErrType)]) }
208
208
  def transpose(err); end
@@ -36,10 +36,10 @@ module Mangrove
36
36
  sig { abstract.params(block: T.proc.returns(T.untyped)).returns(OkType) }
37
37
  def expect_with!(&block); end
38
38
 
39
- sig { abstract.params(block: T.proc.params(this: OkType).returns(Result[OkType, ErrType])).returns(Result[OkType, ErrType]) }
39
+ sig { abstract.type_parameters(:NewOkType).params(block: T.proc.params(this: OkType).returns(Result[T.type_parameter(:NewOkType), ErrType])).returns(Result[T.type_parameter(:NewOkType), ErrType]) }
40
40
  def map_ok(&block); end
41
41
 
42
- sig { abstract.params(block: T.proc.params(this: ErrType).returns(Result[OkType, ErrType])).returns(Result[OkType, ErrType]) }
42
+ sig { abstract.type_parameters(:NewErrType).params(block: T.proc.params(this: ErrType).returns(Result[OkType, T.type_parameter(:NewErrType)])).returns(Result[OkType, T.type_parameter(:NewErrType)]) }
43
43
  def map_err(&block); end
44
44
 
45
45
  class << self
@@ -116,14 +116,14 @@ module Mangrove
116
116
  sig { override.returns(T::Boolean) }
117
117
  def err? = false
118
118
 
119
- sig { override.params(block: T.proc.params(this: OkType).returns(Result[OkType, ErrType])).returns(Result[OkType, ErrType]) }
119
+ sig { override.type_parameters(:NewOkType).params(block: T.proc.params(this: OkType).returns(Result[T.type_parameter(:NewOkType), ErrType])).returns(Result[T.type_parameter(:NewOkType), ErrType]) }
120
120
  def map_ok(&block)
121
121
  block.call(@inner)
122
122
  end
123
123
 
124
- sig { override.params(_block: T.proc.params(this: ErrType).returns(Result[OkType, ErrType])).returns(Result[OkType, ErrType]) }
124
+ sig { override.type_parameters(:NewErrType).params(_block: T.proc.params(this: ErrType).returns(Result[OkType, T.type_parameter(:NewErrType)])).returns(Result[OkType, T.type_parameter(:NewErrType)]) }
125
125
  def map_err(&_block)
126
- self
126
+ T.cast(self, Result::Ok[OkType, T.type_parameter(:NewErrType)])
127
127
  end
128
128
 
129
129
  sig { returns(String) }
@@ -185,12 +185,12 @@ module Mangrove
185
185
  sig { override.returns(T::Boolean) }
186
186
  def err? = true
187
187
 
188
- sig { override.params(_block: T.proc.params(this: OkType).returns(Result[OkType, ErrType])).returns(Result[OkType, ErrType]) }
188
+ sig { override.type_parameters(:NewOkType).params(_block: T.proc.params(this: OkType).returns(Result[T.type_parameter(:NewOkType), ErrType])).returns(Result[T.type_parameter(:NewOkType), ErrType]) }
189
189
  def map_ok(&_block)
190
- self
190
+ T.cast(self, Result::Err[T.type_parameter(:NewOkType), ErrType])
191
191
  end
192
192
 
193
- sig { override.params(block: T.proc.params(this: ErrType).returns(Result[OkType, ErrType])).returns(Result[OkType, ErrType]) }
193
+ sig { override.type_parameters(:NewErrType).params(block: T.proc.params(this: ErrType).returns(Result[OkType, T.type_parameter(:NewErrType)])).returns(Result[OkType, T.type_parameter(:NewErrType)]) }
194
194
  def map_err(&block)
195
195
  block.call(@inner)
196
196
  end
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Mangrove
5
- VERSION = "0.10.1"
5
+ VERSION = "0.12.0"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mangrove
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuma Murata