Class: Unsound::Data::Nothing
Instance Method Summary collapse
-
#>> ⇒ Data::Nothing
(also: #and_then)
A Noop.
-
#fmap ⇒ Data::Nothing
A Noop.
-
#or_else(f = nil, &blk) ⇒ Data::Nothing, Data::Just
Chain another operation which can result in a Maybe.
Methods inherited from Maybe
Instance Method Details
#>> ⇒ Data::Nothing Also known as: and_then
A Noop
44 45 46 |
# File 'lib/unsound/data/maybe.rb', line 44 def >>(*) self end |
#fmap ⇒ Data::Nothing
A Noop
37 38 39 |
# File 'lib/unsound/data/maybe.rb', line 37 def fmap(*) self end |
#or_else(f = nil, &blk) ⇒ Data::Nothing, Data::Just
Chain another operation which can result in a Maybe
53 54 55 |
# File 'lib/unsound/data/maybe.rb', line 53 def or_else(f = nil, &blk) (f || blk).call end |