class Unsound::Data::Nothing
Public Instance Methods
>>(*)
click to toggle source
A Noop
@return [Data::Nothing]
# File lib/unsound/data/maybe.rb, line 45 def >>(*) self end
Also aliased as: and_then
fmap(*)
click to toggle source
A Noop
@return [Data::Nothing]
# File lib/unsound/data/maybe.rb, line 38 def fmap(*) self end
maybe(_, f)
click to toggle source
Call the specified function with no arguments
@param _ [#call] a function that will never be called @param f [#call] a function that takes no arguments
# File lib/unsound/data/maybe.rb, line 62 def maybe(_, f) f[] end
or_else(f = nil, &blk)
click to toggle source
Chain another operation which can result in a {Data::Maybe}
@param f the next operation @return [Data::Nothing, Data::Just]
# File lib/unsound/data/maybe.rb, line 54 def or_else(f = nil, &blk) (f || blk).call end