fold<B> method

  1. @override
B fold<B>(
  1. B ifLeft(
    1. L left
    ),
  2. B ifRight(
    1. 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);
}