fold<B> method
B
fold<
B>( - B ifLeft(
- L left
),
- B ifRight(
- R right
)
)
override
Applies one of two functions depending on whether this is a Left or Right.
- If this is a Left, returns
ifLeft(left).
- If this is a Right, returns
ifRight(right).
Implementation
@override
B fold<B>(B Function(L left) ifLeft, B Function(R right) ifRight) {
return ifLeft(value);
}