fold<Z> abstract method

Z fold<Z>(
  1. Z onLeft(
    1. L
    ),
  2. Z onRight(
    1. R
    )
)

Applies onLeft if this is a Left or onRight if this is a Right

Implementation

Z fold<Z>(Z Function(L) onLeft, Z Function(R) onRight);