Class: Obfusk::Monads::Either
Class Method Summary
collapse
#>>, included
Methods included from ADT
#<=>, #==, #__adt_ctor__, #__adt_ctor_keys__, #__adt_ctor_name__, #__adt_data__, #_compare_data, #_eq_data, #clone, #eql?, included, #initialize, #inspect, #match, #to_s
Class Method Details
.bind_pass(m, &b) ⇒ Object
65
66
67
68
|
# File 'lib/obfusk/monads.rb', line 65
def self.bind_pass(m, &b)
m.match Left: -> (_) { m },
Right: -> (x) { b[x.value] }
end
|
.mreturn(x) ⇒ Object
62
63
64
|
# File 'lib/obfusk/monads.rb', line 62
def self.mreturn(x)
Right(x)
end
|