flatMap<U> method

Result<U, E> flatMap<U>(
  1. Result<U, E> transform(
    1. T value
    )
)

Chains another Result-returning operation (monadic flatMap)

Implementation

Result<U, E> flatMap<U>(Result<U, E> Function(T value) transform) {
  return this is Ok<T, E>
      ? transform((this as Ok<T, E>).value)
      : this as Err<U, E>;
}