map<W> method

FutureResult<W, F> map<W>(
  1. FutureOr<W> fn(
    1. S ok
    )
)

Implementation

FutureResult<W, F> map<W>(FutureOr<W> Function(S ok) fn) {
  return mapOrElse(
    Err.new,
    (ok) async {
      return Ok(await fn(ok));
    },
  );
}