import * as tsplus_module_1 from "@effect/core/io/Effect/operations/failCauseNow";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/zipRight";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/foldCauseEffect";
/**
 * Returns an effect that effectually "peeks" at the cause of the failure of
 * this effect.
 *
 * @tsplus fluent ets/Effect tapErrorCause
 */

export function tapErrorCause_(self, f, __tsplusTrace) {
  return tsplus_module_4.foldCauseEffect_(self, cause => tsplus_module_2.zipRight_(f(cause), () => tsplus_module_1.failCauseNow(cause, __tsplusTrace), __tsplusTrace), tsplus_module_3.succeedNow, __tsplusTrace);
}
/**
 * Returns an effect that effectually "peeks" at the cause of the failure of
 * this effect.
 *
 * @tsplus static ets/Effect/Aspects tapErrorCause
 */

export const tapErrorCause = (f, __tsplusTrace) => self => tapErrorCause_(self, f, __tsplusTrace);
//# sourceMappingURL=tapErrorCause.mjs.map