dry-monads 1.3.5 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +140 -80
- data/LICENSE +1 -1
- data/README.md +5 -4
- data/dry-monads.gemspec +30 -30
- data/lib/dry-monads.rb +1 -1
- data/lib/dry/monads.rb +2 -2
- data/lib/dry/monads/all.rb +2 -2
- data/lib/dry/monads/constants.rb +1 -1
- data/lib/dry/monads/do.rb +52 -18
- data/lib/dry/monads/do/all.rb +36 -17
- data/lib/dry/monads/either.rb +7 -7
- data/lib/dry/monads/errors.rb +5 -2
- data/lib/dry/monads/lazy.rb +15 -4
- data/lib/dry/monads/list.rb +28 -28
- data/lib/dry/monads/maybe.rb +87 -19
- data/lib/dry/monads/registry.rb +10 -10
- data/lib/dry/monads/result.rb +38 -12
- data/lib/dry/monads/result/fixed.rb +33 -24
- data/lib/dry/monads/right_biased.rb +35 -16
- data/lib/dry/monads/task.rb +20 -20
- data/lib/dry/monads/transformer.rb +2 -1
- data/lib/dry/monads/traverse.rb +7 -1
- data/lib/dry/monads/try.rb +45 -12
- data/lib/dry/monads/unit.rb +6 -2
- data/lib/dry/monads/validated.rb +20 -16
- data/lib/dry/monads/version.rb +1 -1
- data/lib/json/add/dry/monads/maybe.rb +3 -3
- metadata +18 -69
- data/.codeclimate.yml +0 -12
- data/.github/ISSUE_TEMPLATE/----please-don-t-ask-for-support-via-issues.md +0 -10
- data/.github/ISSUE_TEMPLATE/---bug-report.md +0 -30
- data/.github/ISSUE_TEMPLATE/---feature-request.md +0 -18
- data/.github/workflows/ci.yml +0 -52
- data/.github/workflows/docsite.yml +0 -34
- data/.github/workflows/sync_configs.yml +0 -56
- data/.gitignore +0 -10
- data/.rspec +0 -4
- data/.rubocop.yml +0 -101
- data/.yardopts +0 -4
- data/CODE_OF_CONDUCT.md +0 -13
- data/CONTRIBUTING.md +0 -29
- data/Gemfile +0 -19
- data/Gemfile.devtools +0 -14
- data/Rakefile +0 -8
- data/bin/.gitkeep +0 -0
- data/bin/console +0 -17
- data/bin/setup +0 -7
- data/docsite/source/case-equality.html.md +0 -42
- data/docsite/source/do-notation.html.md +0 -207
- data/docsite/source/getting-started.html.md +0 -142
- data/docsite/source/index.html.md +0 -179
- data/docsite/source/list.html.md +0 -87
- data/docsite/source/maybe.html.md +0 -146
- data/docsite/source/pattern-matching.html.md +0 -68
- data/docsite/source/result.html.md +0 -190
- data/docsite/source/task.html.md +0 -126
- data/docsite/source/tracing-failures.html.md +0 -32
- data/docsite/source/try.html.md +0 -76
- data/docsite/source/unit.html.md +0 -36
- data/docsite/source/validated.html.md +0 -88
- data/log/.gitkeep +0 -0
- data/project.yml +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06e9ae65089e5f79f92b2d1c67d463757dc960af7a7edbd92d527c0fb6cfd997
|
4
|
+
data.tar.gz: 9d49d077c77edd1580bcc0cdd97fce2d527cabd9013b71611340b14ef6dae7d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5720b87b50ce55e727f169e3bf62d4ad23aa0b6779b8086e326b79cf0242b93fc9f89f840f1a3d6718d2401461a19eea6e4f0679e91499816ccf295aee619d1d
|
7
|
+
data.tar.gz: c95f43c4a51dd831d248cae4bc1afa8d226743e295081dfc4bf05a58c2e18aa146afd64dedb415b8189bbf3f2f54c0c0edb9033fb5a9367551f3fb6d88c37374
|
data/CHANGELOG.md
CHANGED
@@ -1,34 +1,91 @@
|
|
1
|
-
|
1
|
+
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
2
|
|
3
|
-
##
|
3
|
+
## 1.4.0 2021-07-20
|
4
|
+
|
5
|
+
|
6
|
+
### Added
|
7
|
+
|
8
|
+
- `Unit` destructures to an empty array (flash-gordon)
|
9
|
+
- When `.value!` called on a `Failure` value the error references to the value (rewritten + flash-gordon)
|
10
|
+
```ruby
|
11
|
+
begin
|
12
|
+
Failure("oops").value!
|
13
|
+
rescue => error
|
14
|
+
error.receiver # => Failure("oops")
|
15
|
+
end
|
16
|
+
```
|
17
|
+
- `Result#alt_map` for mapping failure values (flash-gordon)
|
18
|
+
```ruby
|
19
|
+
Failure("oops").alt_map(&:upcase) # => Failure("OOPS")
|
20
|
+
```
|
21
|
+
- `Try#recover` recovers from errors (flash-gordon)
|
22
|
+
```ruby
|
23
|
+
error = Try { Hash.new.fetch(:missing) }
|
24
|
+
error.recover(KeyError) { 'default' } # => Try::Value("default")
|
25
|
+
```
|
26
|
+
- `Maybe#filter` runs a predicate against the wrapped value. Returns `None` if the result is false (flash-gordon)
|
27
|
+
```ruby
|
28
|
+
Some(3).filter(&:odd?) # => Some(3)
|
29
|
+
Some(3).filter(&:even?) # => None
|
30
|
+
# no block given
|
31
|
+
Some(3 == 5).filter # => None
|
32
|
+
```
|
33
|
+
- `RightBiased#|` is an alias for `#or` (flash-gordon)
|
34
|
+
```ruby
|
35
|
+
None() | Some(6) | Some(7) # => Some(6)
|
36
|
+
Failure() | Success("one") | Success("two") # => Success("one")
|
37
|
+
```
|
38
|
+
|
39
|
+
### Fixed
|
40
|
+
|
41
|
+
- Do notation preserves method visibility (anicholson + flash-gordon)
|
42
|
+
|
43
|
+
### Changed
|
44
|
+
|
45
|
+
- Coercing `nil` values to `None` with `Some#fmap` is officially deprecated. (flash-gordon)
|
46
|
+
Switch to `Some#maybe` when you expect `nil`.
|
47
|
+
This behavior will be dropped in 2.0 but you can opt out of warnings for the time being
|
48
|
+
```ruby
|
49
|
+
Dry::Monads::Maybe.warn_on_implicit_nil_coercion false
|
50
|
+
```
|
51
|
+
- Minimal Ruby version is 2.6
|
52
|
+
|
53
|
+
[Compare v1.3.5...v1.4.0](https://github.com/dry-rb/dry-monads/compare/v1.3.5...v1.4.0)
|
54
|
+
|
55
|
+
## 1.3.5 2020-01-06
|
56
|
+
|
57
|
+
|
58
|
+
### Added
|
4
59
|
|
5
60
|
- Smarter keys deconstruction in pattern matching (flash-gordon)
|
6
61
|
|
62
|
+
|
7
63
|
[Compare v1.3.4...v1.3.5](https://github.com/dry-rb/dry-monads/compare/v1.3.4...v1.3.5)
|
8
64
|
|
9
|
-
|
65
|
+
## 1.3.4 2019-12-28
|
66
|
+
|
10
67
|
|
11
|
-
|
68
|
+
### Fixed
|
12
69
|
|
13
70
|
- One more delegation warning happenning in do notation (flash-gordon)
|
14
71
|
|
72
|
+
|
15
73
|
[Compare v1.3.3...v1.3.4](https://github.com/dry-rb/dry-monads/compare/v1.3.3...v1.3.4)
|
16
74
|
|
17
|
-
|
75
|
+
## 1.3.3 2019-12-11
|
76
|
+
|
18
77
|
|
19
|
-
|
78
|
+
### Fixed
|
20
79
|
|
21
80
|
- Incompatibility with Rails. Internal (!) halt exceptions now use mutable backtraces because spring [mutates](https://github.com/rails/spring/blob/ee687859008e947bc905b95121e306e2948d31c9/lib/spring/application.rb#L295-L311) (!) them. For the record, this a bug in Rails (johnmaxwell)
|
22
81
|
|
23
|
-
[Compare v1.3.2...v1.3.3](https://github.com/dry-rb/dry-monads/compare/v1.3.2...v1.3.3)
|
24
82
|
|
25
|
-
|
83
|
+
[Compare v1.3.2...v1.3.3](https://github.com/dry-rb/dry-monads/compare/v1.3.2...v1.3.3)
|
26
84
|
|
27
|
-
##
|
85
|
+
## 1.3.2 2019-11-30
|
28
86
|
|
29
|
-
- Warnings about keywords from Ruby 2.7 (flash-gordon)
|
30
87
|
|
31
|
-
|
88
|
+
### Added
|
32
89
|
|
33
90
|
- Pattern matching syntax was improved by implementing `#deconstruct_keys`. Now curly braces aren't necessary when the wrapped value is a Hash (flash-gordon)
|
34
91
|
```ruby
|
@@ -36,28 +93,30 @@
|
|
36
93
|
in Success(code: 200...300) then :ok
|
37
94
|
end
|
38
95
|
```
|
96
|
+
- ## Internal
|
97
|
+
- Performance of do notation was improved for failing cases (1.2x to 1.3x on synthetic benchmarks) (flash-gordon)
|
39
98
|
|
40
|
-
|
99
|
+
### Fixed
|
100
|
+
|
101
|
+
- Warnings about keywords from Ruby 2.7 (flash-gordon)
|
41
102
|
|
42
|
-
- Performance of do notation was improved for failing cases (1.2x to 1.3x on synthetic benchmarks) (flash-gordon)
|
43
103
|
|
44
104
|
[Compare v1.3.1...v1.3.2](https://github.com/dry-rb/dry-monads/compare/v1.3.1...v1.3.2)
|
45
105
|
|
46
|
-
|
106
|
+
## 1.3.1 2019-09-07
|
47
107
|
|
48
|
-
|
108
|
+
|
109
|
+
### Fixed
|
49
110
|
|
50
111
|
- Added missing `None#maybe` :sweat_smile: (flash-gordon)
|
51
112
|
|
52
|
-
[Compare v1.3.0...v1.3.1](https://github.com/dry-rb/dry-monads/compare/v1.3.0...v1.3.1)
|
53
113
|
|
54
|
-
|
114
|
+
[Compare v1.3.0...v1.3.1](https://github.com/dry-rb/dry-monads/compare/v1.3.0...v1.3.1)
|
55
115
|
|
56
|
-
##
|
116
|
+
## 1.3.0 2019-08-03
|
57
117
|
|
58
|
-
- Support for Ruby 2.3 was dropped.
|
59
118
|
|
60
|
-
|
119
|
+
### Added
|
61
120
|
|
62
121
|
- `Result#either` (waiting-for-dev)
|
63
122
|
```ruby
|
@@ -101,7 +160,6 @@
|
|
101
160
|
Dry::Monads.Success(a + b)
|
102
161
|
end
|
103
162
|
```
|
104
|
-
|
105
163
|
- `{Some,Success,Failure}#[]` shortcuts for building arrays wrapped within monadic value (flash-gordon)
|
106
164
|
```ruby
|
107
165
|
Success[1, 2] # => Success([1, 2])
|
@@ -117,7 +175,6 @@
|
|
117
175
|
end
|
118
176
|
end # => List[1, 2, 3, 4, 5]
|
119
177
|
```
|
120
|
-
|
121
178
|
- Experimental support for pattern matching! :tada: (flash-gordon)
|
122
179
|
|
123
180
|
```ruby
|
@@ -140,15 +197,13 @@
|
|
140
197
|
|
141
198
|
Keep in mind this feature is experimental and can be changed by 2.7 release. But it rocks already!
|
142
199
|
|
143
|
-
[Compare v1.2.0...v1.3.0](https://github.com/dry-rb/dry-monads/compare/v1.2.0...v1.3.0)
|
144
200
|
|
145
|
-
|
201
|
+
[Compare v1.2.0...v1.3.0](https://github.com/dry-rb/dry-monads/compare/v1.2.0...v1.3.0)
|
146
202
|
|
147
|
-
##
|
203
|
+
## 1.2.0 2019-01-12
|
148
204
|
|
149
|
-
- Support for Ruby 2.2 was dropped. Ruby 2.2 reached its EOL on March 31, 2018.
|
150
205
|
|
151
|
-
|
206
|
+
### Added
|
152
207
|
|
153
208
|
- Most of constructors now have `call` alias so you can compose them with Procs nicely if you've switched to Ruby 2.6 (flash-gordon)
|
154
209
|
```ruby
|
@@ -177,7 +232,6 @@
|
|
177
232
|
List[Some(5), None(), Some(3)].collect.map { |x| x * 2 }
|
178
233
|
# => [10, 6]
|
179
234
|
```
|
180
|
-
|
181
235
|
- Right-biased monads got `#flatten` and `#and` (falsh-gordon)
|
182
236
|
|
183
237
|
`#flatten` removes one level of monadic structure, it's useful when you're dealing with things like `Maybe` of `Maybe` of something:
|
@@ -209,7 +263,6 @@
|
|
209
263
|
Some(5).and(None()) # => None()
|
210
264
|
None().and(Some(5)) # => None()
|
211
265
|
```
|
212
|
-
|
213
266
|
- Concise imports with `Dry::Monads.[]`. You're no longer required to require all desired monads and include them one-by-one, the `[]` method handles it for you (flash-gordon)
|
214
267
|
|
215
268
|
```ruby
|
@@ -234,18 +287,15 @@
|
|
234
287
|
end
|
235
288
|
end
|
236
289
|
```
|
237
|
-
|
238
290
|
- `Task.failed` is a counterpart of `Task.pure`, accepts an exception and returns a failed task immediately (flash-gordon)
|
239
291
|
|
240
|
-
[Compare v1.1.0...v1.2.0](https://github.com/dry-rb/dry-monads/compare/v1.1.0...v1.2.0)
|
241
292
|
|
242
|
-
|
293
|
+
[Compare v1.1.0...v1.2.0](https://github.com/dry-rb/dry-monads/compare/v1.1.0...v1.2.0)
|
243
294
|
|
244
|
-
##
|
295
|
+
## 1.1.0 2018-10-16
|
245
296
|
|
246
|
-
- Do notation was made to work nicely with inheritance. This shouldn't break any existing code but if it does please report (flash-gordon)
|
247
297
|
|
248
|
-
|
298
|
+
### Added
|
249
299
|
|
250
300
|
- `Success()`, `Failure()`, and `Some()` now have `Unit` as a default argument:
|
251
301
|
|
@@ -261,26 +311,34 @@
|
|
261
311
|
end
|
262
312
|
```
|
263
313
|
|
264
|
-
|
314
|
+
### Fixed
|
265
315
|
|
266
|
-
|
316
|
+
- Do notation was made to work nicely with inheritance. This shouldn't break any existing code but if it does please report (flash-gordon)
|
267
317
|
|
268
|
-
## Fixed
|
269
318
|
|
270
|
-
|
319
|
+
[Compare v1.0.1...v1.1.0](https://github.com/dry-rb/dry-monads/compare/v1.0.1...v1.1.0)
|
271
320
|
|
272
|
-
##
|
321
|
+
## 1.0.1 2018-08-11
|
322
|
+
|
323
|
+
|
324
|
+
### Added
|
273
325
|
|
274
326
|
- `to_proc` was added to value constructors (flash-gordon)
|
275
327
|
```ruby
|
276
328
|
[1, 2, 3].map(&Some) # => [Some(1), Some(2), Some(3)]
|
277
329
|
```
|
278
330
|
|
331
|
+
### Fixed
|
332
|
+
|
333
|
+
- Fixed behavior of `List<Validated>#traverse` in presence of `Valid` values (flash-gordon + SunnyMagadan)
|
334
|
+
|
335
|
+
|
279
336
|
[Compare v1.0.0...v1.0.1](https://github.com/dry-rb/dry-monads/compare/v1.0.0...v1.0.1)
|
280
337
|
|
281
|
-
|
338
|
+
## 1.0.0 2018-06-26
|
282
339
|
|
283
|
-
|
340
|
+
|
341
|
+
### Added
|
284
342
|
|
285
343
|
- `do`-like notation (the idea comes from Haskell of course). This is the biggest and most important addition to the release which greatly increases the ergonomics of using monads in Ruby. Basically, almost everything it does is passing a block to a given method. You call `yield` on monads to extract the values. If any operation fails i.e. no value can be extracted, the whole computation is halted and the failing step becomes a result. With `Do` you don't need to chain monadic values with `fmap/bind` and block, everything can be done on a single level of indentation. Here is a more or less real-life example:
|
286
344
|
|
@@ -332,7 +390,6 @@
|
|
332
390
|
```
|
333
391
|
|
334
392
|
In the code above any `yield` can potentially fail and return the failure reason as a result. In other words, `yield None` acts as `return None`. Internally, `Do` uses exceptions, not `return`, this is somewhat slower but allows to detect failed operations in DB-transactions and roll back the changes which far more useful than an unjustifiable speed boost (flash-gordon)
|
335
|
-
|
336
393
|
- The `Task` monad based on `Promise` from the [`concurrent-ruby` gem](https://github.com/ruby-concurrency/concurrent-ruby/). `Task` represents an asynchronous computation which _can be_ (doesn't have to!) run on a separated thread. `Promise` already offers a good API and implemented in a safe manner so `dry-monads` just adds a monad-compatible interface for it. Out of the box, `concurrent-ruby` has three types of executors for running blocks: `:io`, `:fast`, `:immediate`, check out [the docs](http://ruby-concurrency.github.io/concurrent-ruby/root/Concurrent.html#executor-class_method) for details. You can provide your own executor if needed (flash-gordon)
|
337
394
|
|
338
395
|
```ruby
|
@@ -358,9 +415,7 @@
|
|
358
415
|
Success(create(e, n))
|
359
416
|
end
|
360
417
|
```
|
361
|
-
|
362
418
|
- `Lazy` is a copy of `Task` that isn't run until you ask for the value _for the first time_. It is guaranteed the evaluation is run at most once as opposed to lazy assignment `||=` which isn't synchronized. `Lazy` is run on the same thread asking for the value (flash-gordon)
|
363
|
-
|
364
419
|
- Automatic type inference with `.typed` for lists was deprecated. Instead, typed list builders were added
|
365
420
|
|
366
421
|
```ruby
|
@@ -369,7 +424,6 @@
|
|
369
424
|
```
|
370
425
|
|
371
426
|
The code above runs two tasks in parallel and automatically combines their results with `traverse` (flash-gordon)
|
372
|
-
|
373
427
|
- `Try` got a new call syntax supported in Ruby 2.5+
|
374
428
|
|
375
429
|
```ruby
|
@@ -377,7 +431,6 @@
|
|
377
431
|
```
|
378
432
|
|
379
433
|
Prior to 2.5, it wasn't possible to pass a block to `[]`.
|
380
|
-
|
381
434
|
- The `Validated` “monad” that represents a result of a validation. Suppose, you want to collect all the errors and return them at once. You can't have it with `Result` because when you `traverse` a `List` of `Result`s it returns the first value and this is the correct behavior from the theoretical point of view. `Validated`, in fact, doesn't have a monad instance but provides a useful variant of applicative which concatenates the errors.
|
382
435
|
|
383
436
|
```ruby
|
@@ -401,13 +454,11 @@
|
|
401
454
|
```
|
402
455
|
|
403
456
|
In the example above an array of `Validated` values is implicitly coerced to `List::Validated`. It's supported because it's useful but don't forget it's all about types so don't mix different types of monads in a single array, the consequences are unclear. You always can be explicit with `List::Validated[validate_name(...), ...]`, choose what you like (flash-gordon).
|
404
|
-
|
405
457
|
- `Failure`, `None`, and `Invalid` values now store the line where they were created. One of the biggest downsides of dealing with monadic code is lack of backtraces. If you have a long list of computations and one of them fails how do you know where did it actually happen? Say, you've got `None` and this tells you nothing about _what variable_ was assigned to `None`. It makes sense to use `Result` instead of `Maybe` and use distinct errors everywhere but it doesn't always look good and forces you to think more. TLDR; call `.trace` to get the line where a fail-case was constructed
|
406
458
|
|
407
459
|
```ruby
|
408
460
|
Failure(:invalid_name).trace # => app/operations/create_user.rb:43
|
409
461
|
```
|
410
|
-
|
411
462
|
- `Dry::Monads::Unit` which can be used as a replacement for `Success(nil)` and in similar situations when you have side effects yet doesn't return anything meaningful as a result. There's also the `.discard` method for mapping any successful result (i.e. `Success(?)`, `Some(?)`, `Value(?)`, etc) to `Unit`.
|
412
463
|
|
413
464
|
```ruby
|
@@ -417,26 +468,19 @@
|
|
417
468
|
# ... wait for the task to finish ...
|
418
469
|
# => Task(valut=Unit)
|
419
470
|
```
|
420
|
-
|
421
|
-
## Deprecations
|
422
|
-
|
471
|
+
- ## Deprecations
|
423
472
|
- `Either`, the former name of `Result`, is now deprecated
|
424
|
-
|
425
|
-
## BREAKING CHANGES
|
426
|
-
|
473
|
+
- ## BREAKING CHANGES
|
427
474
|
- `Either#value` and `Maybe#value` were both droped, use `value_or` or `value!` when you :100: sure it's safe
|
428
475
|
- `require 'dry/monads'` doesn't load all monads anymore, use `require 'dry/monads/all'` instead or cherry pick them with `require 'dry/monads/maybe'` etc (timriley)
|
429
476
|
|
430
|
-
[Compare v0.4.0...v1.0.0](https://github.com/dry-rb/dry-monads/compare/v0.4.0...v1.0.0)
|
431
477
|
|
432
|
-
|
478
|
+
[Compare v0.4.0...v1.0.0](https://github.com/dry-rb/dry-monads/compare/v0.4.0...v1.0.0)
|
433
479
|
|
434
|
-
##
|
480
|
+
## 0.4.0 2017-11-11
|
435
481
|
|
436
|
-
- The `Either` monad was renamed to `Result` which sounds less nerdy but better reflects the purpose of the type. `Either::Right` became `Result::Success` and `Either::Left` became `Result::Failure`. This change is backward-compatible overall but you will see the new names when using old `Left` and `Right` methods (citizen428)
|
437
|
-
- Consequently, `Try::Success` and `Try::Failure` were renamed to `Try::Value` and `Try::Error` (flash-gordon)
|
438
482
|
|
439
|
-
|
483
|
+
### Added
|
440
484
|
|
441
485
|
- `Try#or`, works as `Result#or` (flash-gordon)
|
442
486
|
- `Maybe#success?` and `Maybe#failure?` (aliases for `#some?` and `#none?`) (flash-gordon)
|
@@ -451,24 +495,30 @@
|
|
451
495
|
else raise TypeError
|
452
496
|
end
|
453
497
|
```
|
498
|
+
- ## Deprecated
|
499
|
+
- Direct accessing `value` on right-biased monads has been deprecated, use the `value!` method instead. `value!` will raise an exception if it is called on a Failure/None/Error instance (flash-gordon)
|
454
500
|
|
455
|
-
|
501
|
+
### Changed
|
456
502
|
|
457
|
-
-
|
503
|
+
- The `Either` monad was renamed to `Result` which sounds less nerdy but better reflects the purpose of the type. `Either::Right` became `Result::Success` and `Either::Left` became `Result::Failure`. This change is backward-compatible overall but you will see the new names when using old `Left` and `Right` methods (citizen428)
|
504
|
+
- Consequently, `Try::Success` and `Try::Failure` were renamed to `Try::Value` and `Try::Error` (flash-gordon)
|
458
505
|
|
459
506
|
[Compare v0.3.1...v0.4.0](https://github.com/dry-rb/dry-monads/compare/v0.3.1...v0.4.0)
|
460
507
|
|
461
|
-
|
508
|
+
## 0.3.1 2017-03-18
|
462
509
|
|
463
|
-
|
510
|
+
|
511
|
+
### Fixed
|
464
512
|
|
465
513
|
- Fixed unexpected coercing to `Hash` on `.bind` call (flash-gordon)
|
466
514
|
|
515
|
+
|
467
516
|
[Compare v0.3.0...v0.3.1](https://github.com/dry-rb/dry-monads/compare/v0.3.0...v0.3.1)
|
468
517
|
|
469
|
-
|
518
|
+
## 0.3.0 2017-03-16
|
470
519
|
|
471
|
-
|
520
|
+
|
521
|
+
### Added
|
472
522
|
|
473
523
|
- Added `Either#either` that accepts two callbacks, runs the first if it is `Right` and the second otherwise (nkondratyev)
|
474
524
|
- Added `#fmap2` and `#fmap3` for mapping over nested structures like `List Either` and `Either Some` (flash-gordon)
|
@@ -478,59 +528,69 @@
|
|
478
528
|
- Added `List#traverse` that "flips" the list with an embedded monad (flash-gordon + damncabbage)
|
479
529
|
- Added `#tee` for all right-biased monads (flash-gordon)
|
480
530
|
|
531
|
+
|
481
532
|
[Compare v0.2.1...v0.3.0](https://github.com/dry-rb/dry-monads/compare/v0.2.1...v0.3.0)
|
482
533
|
|
483
|
-
|
534
|
+
## 0.2.1 2016-11-13
|
535
|
+
|
484
536
|
|
485
|
-
|
537
|
+
### Added
|
486
538
|
|
487
539
|
- Added `Either#tee` that is similar to `Object#tap` but executes the block only for `Right` instances (saverio-kantox)
|
488
540
|
|
489
|
-
|
541
|
+
### Fixed
|
490
542
|
|
491
543
|
- `Right(nil).to_maybe` now returns `None` with a warning instead of failing (orisaka)
|
492
544
|
- `Some#value_or` doesn't require an argument because `None#value_or` doesn't require it either if a block was passed (flash-gordon)
|
493
545
|
|
546
|
+
|
494
547
|
[Compare v0.2.0...v0.2.1](https://github.com/dry-rb/dry-monads/compare/v0.2.0...v0.2.1)
|
495
548
|
|
496
|
-
|
549
|
+
## 0.2.0 2016-09-18
|
550
|
+
|
497
551
|
|
498
|
-
|
552
|
+
### Added
|
499
553
|
|
500
554
|
- Added `Maybe#to_json` as an opt-in extension for serialization to JSON (rocknruby)
|
501
555
|
- Added `Maybe#value_or` which returns you the underlying value with a fallback in a single method call (dsounded)
|
502
556
|
|
557
|
+
|
503
558
|
[Compare v0.1.1...v0.2.0](https://github.com/dry-rb/dry-monads/compare/v0.1.1...v0.2.0)
|
504
559
|
|
505
|
-
|
560
|
+
## 0.1.1 2016-08-25
|
506
561
|
|
507
|
-
|
562
|
+
|
563
|
+
### Fixed
|
508
564
|
|
509
565
|
- Added explicit requires of `dry-equalizer`. This allows to safely load only specific monads (artofhuman)
|
510
566
|
|
567
|
+
|
511
568
|
[Compare v0.1.0...v0.1.1](https://github.com/dry-rb/dry-monads/compare/v0.1.0...v0.1.1)
|
512
569
|
|
513
|
-
|
570
|
+
## 0.1.0 2016-08-23
|
571
|
+
|
514
572
|
|
515
|
-
|
573
|
+
### Added
|
516
574
|
|
517
575
|
- Support for passing extra arguments to the block in `.bind` and `.fmap` (flash-gordon)
|
518
576
|
|
519
|
-
|
577
|
+
### Changed
|
520
578
|
|
521
579
|
- Dropped MRI 2.0 support (flash-gordon)
|
522
580
|
|
523
581
|
[Compare v0.0.2...v0.1.0](https://github.com/dry-rb/dry-monads/compare/v0.0.2...v0.1.0)
|
524
582
|
|
525
|
-
|
583
|
+
## 0.0.2 2016-06-29
|
526
584
|
|
527
|
-
|
585
|
+
|
586
|
+
### Added
|
528
587
|
|
529
588
|
- Added `Either#to_either` so that you can rely on duck-typing when you work with different types of monads (timriley)
|
530
589
|
- Added `Maybe#to_maybe` for consistency with `#to_either` (flash-gordon)
|
531
590
|
|
591
|
+
|
532
592
|
[Compare v0.0.1...v0.0.2](https://github.com/dry-rb/dry-monads/compare/v0.0.1...v0.0.2)
|
533
593
|
|
534
|
-
|
594
|
+
## 0.0.1 2016-05-02
|
535
595
|
|
536
596
|
Initial release containing `Either`, `Maybe`, and `Try` monads.
|