import * as tsplus_module_1 from "@effect/core/io/Effect/operations/foldCauseEffect";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/forkDaemon";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/unit";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/interruption";
/**
 * @tsplus fluent ets/Effect onDoneCause
 */

export function onDoneCause_(self, error, success, __tsplusTrace) {
  return tsplus_module_4.uninterruptibleMask(({
    restore
  }) => tsplus_module_3.unit_(tsplus_module_2.forkDaemon(tsplus_module_1.foldCauseEffect_(restore(() => self, __tsplusTrace), e => restore(() => error(e), __tsplusTrace), s => restore(() => success(s), __tsplusTrace), __tsplusTrace), __tsplusTrace), __tsplusTrace), __tsplusTrace);
}
/**
 * @tsplus static ets/Effect/Aspects onDoneCause
 */

export const onDoneCause = (error, success, __tsplusTrace) => self => onDoneCause_(self, error, success, __tsplusTrace);
//# sourceMappingURL=onDoneCause.mjs.map