flatMapEither<B> method

ZIO<R, E, B> flatMapEither<B>(
  1. Either<E, B> f(
    1. A _
    )
)

A variant of flatMap that uses the resulting Either to determine the result.

Right values are mapped to the success channel, Left values are mapped to the error channel.

Implementation

ZIO<R, E, B> flatMapEither<B>(
  Either<E, B> Function(A _) f,
) =>
    ZIO.from(
      (ctx) => unsafeRun(ctx).then(
        (ea) => ea.flatMapExitEither(f),
      ),
    );