class Unsound::Data::Left

Public Instance Methods

>>(*) click to toggle source

A Noop

@return [Data::Left]

# File lib/unsound/data/either.rb, line 44
def >>(*)
  self
end
Also aliased as: and_then
and_then(*)
Alias for: >>
either(f, _) click to toggle source

Call a function on the value in the {Data::Left}

@param f [#call] a function capable of processing the value @param _ [#call] a function that will never be called

# File lib/unsound/data/either.rb, line 61
def either(f, _)
  f[value]
end
fmap(*) click to toggle source

A Noop

@return [Data::Left]

# File lib/unsound/data/either.rb, line 37
def fmap(*)
  self
end
or_else(f = nil, &blk) click to toggle source

Chain another operation which can result in a {Data::Either}

@param f the next operation @return [Data::Left, Data::Right]

# File lib/unsound/data/either.rb, line 53
def or_else(f = nil, &blk)
  (f || blk)[value]
end