match, with
22 23 24 25 26
# File 'lib/monadt/maybe.rb', line 22 def bind(m, &blk) match(m, with(Maybe::Just) { |v| blk.call(v) }, with(Maybe::Nothing) { m }) end
28 29 30
# File 'lib/monadt/maybe.rb', line 28 def return(a) Maybe::Just.new a end