/** * Returns an effect that effectfully "peeks" at the result of this effect. * * @tsplus static effect/core/io/Effect.Aspects tapEither * @tsplus pipeable effect/core/io/Effect tapEither */ export function tapEither( f: (either: Either) => Effect ) { return (self: Effect): Effect => self.foldCauseEffect( (cause) => cause.failureOrCause.fold( (e) => f(Either.left(e)).zipRight(Effect.failCause(cause)), () => Effect.failCause(cause) ), (a) => f(Either.right(a)).as(a) ) }