Sha256: c51c7ba9411a020a624194833f4a9023bf67447044dce4f6e07321e9157b3826

Contents?: true

Size: 1.27 KB

Versions: 13

Compression:

Stored size: 1.27 KB

Contents

require 'dry/core/deprecations'

Dry::Core::Deprecations.warn('Either monad was renamed to Result', tag: :'dry-monads')

require 'dry/monads/result'

module Dry
  module Monads
    Either = Result
    deprecate_constant :Either

    class Result
      extend Dry::Core::Deprecations[:'dry-monads']

      deprecate :to_either, :to_result

      Right = Success
      Left = Failure

      deprecate_constant :Right
      deprecate_constant :Left

      module Mixin
        module Constructors
          extend Dry::Core::Deprecations[:'dry-monads']

          Right = Success
          Left = Failure
          deprecate_constant :Right
          deprecate_constant :Left

          deprecate :Right, :Success
          deprecate :Left, :Failure
        end
      end

      class Success
        deprecate :left?, :failure?
        deprecate :right?, :success?
      end

      class Failure
        deprecate :left?, :failure?
        deprecate :right?, :success?

        deprecate :left, :failure
      end
    end

    class Try
      class Value
        extend Dry::Core::Deprecations[:'dry-monads']

        deprecate :to_either, :to_result
      end

      class Error
        extend Dry::Core::Deprecations[:'dry-monads']

        deprecate :to_either, :to_result
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
dry-monads-1.3.4 lib/dry/monads/either.rb
dry-monads-1.3.3 lib/dry/monads/either.rb
dry-monads-1.3.2 lib/dry/monads/either.rb
dry-monads-1.3.1 lib/dry/monads/either.rb
dry-monads-1.3.0 lib/dry/monads/either.rb
dry-monads-1.2.0 lib/dry/monads/either.rb
dry-monads-1.1.0 lib/dry/monads/either.rb
dry-monads-1.0.1 lib/dry/monads/either.rb
dry-monads-1.0.0 lib/dry/monads/either.rb
dry-monads-1.0.0.rc1 lib/dry/monads/either.rb
dry-monads-1.0.0.beta3 lib/dry/monads/either.rb
dry-monads-1.0.0.beta2 lib/dry/monads/either.rb
dry-monads-1.0.0.beta1 lib/dry/monads/either.rb