fold<B> abstract method

B fold<B>(
  1. B onOk(
    1. T value
    ),
  2. B onErr(
    1. E error
    )
)

Fold is used to handle both Ok and Err cases.

Implementation

B fold<B>(B Function(T value) onOk, B Function(E error) onErr);