Sha256: e177d4baca7363a231d044ea9e059c098bedaf032966ff73acdb219167a41a05
Contents?: true
Size: 503 Bytes
Versions: 11
Compression:
Stored size: 503 Bytes
Contents
# frozen_string_literal: true require 'kind/basic' module Kind module Either require 'kind/either/monad' require 'kind/either/left' require 'kind/either/right' require 'kind/either/methods' extend self def new(value) Right[value] end alias_method :[], :new def self.from result = yield Either::Monad === result ? result : Either::Right[result] rescue StandardError => e Either::Left[e] end end extend Either::Methods end
Version data entries
11 entries across 11 versions & 1 rubygems