module Kind::Either

Public Class Methods

from() { || ... } click to toggle source
# File lib/kind/either.rb, line 20
def self.from
  result = yield

  Either::Monad === result ? result : Either::Right[result]
rescue StandardError => e
  Either::Left[e]
end

Public Instance Methods

[](value)
Alias for: new
new(value) click to toggle source
# File lib/kind/either.rb, line 14
def new(value)
  Right[value]
end
Also aliased as: []