fold<U extends Object, F extends Object> abstract method

Result<U, F> fold<U extends Object, F extends Object>(
  1. U ok(
    1. T
    ),
  2. F err(
    1. E
    )
)

Invoke either the ok or the err function based on the result.

This is a combination of the map() and mapErr() functions.

Implementation

Result<U, F> fold<U extends Object, F extends Object>(
  U Function(T) ok,
  F Function(E) err,
);