match, with
23 24 25 26 27
# File 'lib/monadt/either.rb', line 23 def bind(m, &blk) match(m, with(Either::Left) { |v| m }, with(Either::Right) { |v| blk.call(v) }) end
29 30 31
# File 'lib/monadt/either.rb', line 29 def return(a) Either::Right.new a end