Class: Either::Right
Constant Summary
Trither::BasicTypes::C, Trither::BasicTypes::Func0, Trither::BasicTypes::Func1, Trither::BasicTypes::Predicate
Constants inherited
from Trither::Box
Trither::Box::C
Instance Method Summary
collapse
#==, #initialize
Constructor Details
This class inherits a constructor from Trither::Box
Instance Method Details
#left? ⇒ Boolean
58
59
60
|
# File 'lib/trither/either.rb', line 58
def left?
false
end
|
#left_flat_map ⇒ Object
83
84
85
|
# File 'lib/trither/either.rb', line 83
def left_flat_map
self
end
|
#left_map ⇒ Object
73
74
75
|
# File 'lib/trither/either.rb', line 73
def left_map
self
end
|
#right ⇒ Object
68
69
70
|
# File 'lib/trither/either.rb', line 68
def right
@value
end
|
#right? ⇒ Boolean
63
64
65
|
# File 'lib/trither/either.rb', line 63
def right?
true
end
|
#right_flat_map {|@value| ... } ⇒ Object
88
89
90
|
# File 'lib/trither/either.rb', line 88
def right_flat_map
yield @value
end
|
#right_map ⇒ Object
78
79
80
|
# File 'lib/trither/either.rb', line 78
def right_map
Right.new(yield @value)
end
|