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

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

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