Skip to content

Releases: dry-rb/dry-monads

v1.7.1

21 Jan 11:37
v1.7.1
Compare
Choose a tag to compare

Fixed

Compare v1.7.0...v1.7.1

v1.7.0

07 Jan 16:16
v1.7.0
Compare
Choose a tag to compare

Fixed

Changed

Compare v1.6.0...v1.7.0

v1.6.0

04 Nov 17:55
v1.6.0
8c42280
Compare
Choose a tag to compare

Changed

Compare v1.5.0...v1.6.0

v1.5.0

16 Oct 17:54
v1.5.0
Compare
Choose a tag to compare

Changed

Compare v1.4.0...v1.5.0

v1.4.0

20 Jul 08:19
v1.4.0
e2b762a
Compare
Choose a tag to compare

Added

  • Unit destructures to an empty array (flash-gordon)
  • When .value! called on a Failure value the error references to the value (rewritten + flash-gordon)
    begin
      Failure("oops").value!
    rescue => error
      error.receiver # => Failure("oops")
    end
  • Result#alt_map for mapping failure values (flash-gordon)
    Failure("oops").alt_map(&:upcase) # => Failure("OOPS")
  • Try#recover recovers from errors (flash-gordon)
    error = Try { Hash.new.fetch(:missing) }
    error.recover(KeyError) { 'default' } # => Try::Value("default")
  • Maybe#filter runs a predicate against the wrapped value. Returns None if the result is false (flash-gordon)
    Some(3).filter(&:odd?)  # => Some(3)
    Some(3).filter(&:even?) # => None
    # no block given
    Some(3 == 5).filter     # => None
  • RightBiased#| is an alias for #or (flash-gordon)
    None() | Some(6) | Some(7) # => Some(6)
    Failure() | Success("one") | Success("two") # => Success("one")

Fixed

  • Do notation preserves method visibility (anicholson + flash-gordon)

Changed

  • Coercing nil values to None with Some#fmap is officially deprecated. (flash-gordon)
    Switch to Some#maybe when you expect nil.
    This behavior will be dropped in 2.0 but you can opt-out of warnings for the time being
    Dry::Monads::Maybe.warn_on_implicit_nil_coercion false
  • Minimal Ruby version is 2.6

Compare v1.3.5...v1.4.0

v1.3.5

06 Jan 12:22
v1.3.5
895ece7
Compare
Choose a tag to compare

Added

  • Smarter keys deconstruction in pattern matching (flash-gordon)

Compare v1.3.4...v1.3.5

v1.3.4

28 Dec 12:57
v1.3.4
7586406
Compare
Choose a tag to compare

v1.3.4 2019-12-28

Fixed

  • One more delegation warning happenning in do notation (flash-gordon)

Compare v1.3.3...v1.3.4

v1.3.3

11 Dec 08:34
v1.3.3
f77581c
Compare
Choose a tag to compare

v1.3.3 2019-12-11

Fixed

  • Incompatibility with Rails. Internal (!) halt exceptions now use mutable backtraces because spring mutates (!) them. For the record, this a bug in Rails (johnmaxwell)

Compare v1.3.2...v1.3.3

v1.3.2

30 Nov 09:04
v1.3.2
21187f2
Compare
Choose a tag to compare

v1.3.2 2019-11-30

Fixed

  • Warnings about keywords from Ruby 2.7 (flash-gordon)

Added

  • Pattern matching syntax was improved by implementing #deconstruct_keys. Now curly braces aren't necessary when the wrapped value is a Hash (flash-gordon)
    case result
    in Success(code: 200...300) then :ok
    end

Internal

  • Performance of do notation was improved for failing cases (1.2x to 1.3x on synthetic benchmarks) (flash-gordon)

Compare v1.3.1...v1.3.2

v1.3.1

07 Sep 19:08
v1.3.1
fc11921
Compare
Choose a tag to compare

v1.3.1 2019-09-07

Fixed

  • Added missing None#maybe 😅 (flash-gordon)

Compare v1.3.0...v1.3.1