lib/dry/monads.rb in dry-monads-0.4.0 vs lib/dry/monads.rb in dry-monads-1.0.0.beta1

- old
+ new

@@ -1,28 +1,49 @@ require 'dry/core/constants' require 'dry/monads/maybe' require 'dry/monads/try' require 'dry/monads/list' +require 'dry/monads/task' +require 'dry/monads/lazy' require 'dry/monads/result' require 'dry/monads/result/fixed' +require 'dry/monads/do' +require 'dry/monads/validated' module Dry + # Common, idiomatic monads for Ruby + # # @api public module Monads + # @private Undefined = Dry::Core::Constants::Undefined + # List of monad constructors CONSTRUCTORS = [ Maybe::Mixin::Constructors, - Result::Mixin::Constructors + Result::Mixin::Constructors, + Validated::Mixin::Constructors, + Try::Mixin::Constructors, + Task::Mixin::Constructors, + Lazy::Mixin::Constructors ].freeze + # @see Maybe::Some Some = Maybe::Some + # @see Maybe::None None = Maybe::None + # @see Result::Success Success = Result::Success + # @see Result::Failure Failure = Result::Failure + # @see Validated::Valid + Valid = Validated::Valid + # @see Validated::Invalid + Invalid = Validated::Invalid extend(*CONSTRUCTORS) + # @private def self.included(base) super base.include(*CONSTRUCTORS) end