import * as tsplus_module_1 from "@effect/core/io/Cause/definition";
import * as tsplus_module_2 from "@effect/core/io/Cause/operations/fold";
import { Both, Die, Fail, Interrupt, Stackless, Then } from "@effect/core/io/Cause/definition";
/**
 * Transforms the traces in this cause with the specified function.
 *
 * @tsplus fluent ets/Cause mapTrace
 */

export function mapTrace_(self, f) {
  return tsplus_module_2.fold_(self, () => tsplus_module_1.empty, (e, trace) => new Fail(e, f(trace)), (d, trace) => new Die(d, f(trace)), (fiberId, trace) => new Interrupt(fiberId, f(trace)), (left, right) => new Then(left, right), (left, right) => new Both(left, right), (cause, stackless) => new Stackless(cause, stackless));
}
/**
 * Transforms the traces in this cause with the specified function.
 *
 * @tsplus static ets/Cause/Aspects mapTrace
 */

export const mapTrace = f => self => mapTrace_(self, f);
//# sourceMappingURL=mapTrace.mjs.map