fold abstract method

Result<Object> fold(
  1. @noFutures Result<Object>? onOk(
    1. Ok<T> ok
    ),
  2. @noFutures Result<Object>? onErr(
    1. Err<T> err
    )
)

Folds the two cases of this Result into a single new Result.

Implementation

Result<Object> fold(
  @noFutures Result<Object>? Function(Ok<T> ok) onOk,
  @noFutures Result<Object>? Function(Err<T> err) onErr,
);