bind<U> method

Result<U, E> bind<U>(
  1. Result<U, E> f(
    1. T
    )
)

Performs a bind operation and returns a new instance with a new type. The 'bind' method allows chaining operations that may fail.

Implementation

Result<U, E> bind<U>(Result<U, E> Function(T) f) => match(
      onSuccess: (value) => f(value),
      onError: Error<U, E>.new,
    );