Class: Unsound::Data::Left
Instance Method Summary collapse
-
#>> ⇒ Data::Left
(also: #and_then)
A Noop.
-
#either(f, _) ⇒ Object
Call a function on the value in the Left.
-
#fmap ⇒ Data::Left
A Noop.
-
#or_else(f = nil, &blk) ⇒ Data::Left, Data::Right
Chain another operation which can result in a Either.
Methods inherited from Either
Instance Method Details
#>> ⇒ Data::Left Also known as: and_then
A Noop
44 45 46 |
# File 'lib/unsound/data/either.rb', line 44 def >>(*) self end |
#either(f, _) ⇒ Object
Call a function on the value in the Unsound::Data::Left
61 62 63 |
# File 'lib/unsound/data/either.rb', line 61 def either(f, _) f[value] end |
#fmap ⇒ Data::Left
A Noop
37 38 39 |
# File 'lib/unsound/data/either.rb', line 37 def fmap(*) self end |
#or_else(f = nil, &blk) ⇒ Data::Left, Data::Right
Chain another operation which can result in a Either
53 54 55 |
# File 'lib/unsound/data/either.rb', line 53 def or_else(f = nil, &blk) (f || blk)[value] end |