Sha256: bc64547d81db063f295d7895296d450c53c39c82c300c656a27802f025be8ff2
Contents?: true
Size: 587 Bytes
Versions: 7
Compression:
Stored size: 587 Bytes
Contents
# frozen_string_literal: true require 'dry/monads/result' module Dry module Types # Monad extension for Result # # @api public class Result include Dry::Monads::Result::Mixin # Turn result into a monad # # This makes result objects work with dry-monads (or anything with a compatible interface) # # @return [Dry::Monads::Success,Dry::Monads::Failure] # # @api public def to_monad if success? Success(input) else Failure([error, input]) end end end end end
Version data entries
7 entries across 7 versions & 2 rubygems