Sha256: c319a549f634b76e1ac14417a0fd3dc1937d26c98f35266c8d5ca8111f7bcbf4
Contents?: true
Size: 562 Bytes
Versions: 11
Compression:
Stored size: 562 Bytes
Contents
# frozen_string_literal: true require 'kind/basic' module Kind module Result require 'kind/result/abstract' require 'kind/result/monad' require 'kind/result/failure' require 'kind/result/success' require 'kind/result/methods' extend self def new(value) Success[value] end alias_method :[], :new def self.from result = yield Result::Monad === result ? result : Result::Success[result] rescue StandardError => e Result::Failure[:exception, e] end end extend Result::Methods end
Version data entries
11 entries across 11 versions & 1 rubygems