matchSync<B> method

RIO<R, B> matchSync<B>(
  1. B onError(
    1. E _
    ),
  2. B onSuccess(
    1. A _
    )
)

A synchronous version of match.

Implementation

RIO<R, B> matchSync<B>(
  B Function(E _) onError,
  B Function(A _) onSuccess,
) =>
    ZIO.from(
      (ctx) => unsafeRun(ctx).then(
        (ea) => ea.matchExit(
          (e) => Either.right(onError(e)),
          (a) => Either.right(onSuccess(a)),
        ),
      ),
    );