Class: Either::Left
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 ⇒ Object
29
30
31
|
# File 'lib/trither/either.rb', line 29
def left
@value
end
|
#left? ⇒ Boolean
19
20
21
|
# File 'lib/trither/either.rb', line 19
def left?
true
end
|
#left_flat_map {|@value| ... } ⇒ Object
44
45
46
|
# File 'lib/trither/either.rb', line 44
def left_flat_map
yield @value
end
|
#left_map ⇒ Object
34
35
36
|
# File 'lib/trither/either.rb', line 34
def left_map
Left.new(yield @value)
end
|
#right? ⇒ Boolean
24
25
26
|
# File 'lib/trither/either.rb', line 24
def right?
false
end
|
#right_flat_map ⇒ Object
49
50
51
|
# File 'lib/trither/either.rb', line 49
def right_flat_map
self
end
|
#right_map ⇒ Object
39
40
41
|
# File 'lib/trither/either.rb', line 39
def right_map
self
end
|