import * as tsplus_module_1 from "@effect/core/io/Cause/operations/failures";
import * as tsplus_module_2 from "@tsplus/stdlib/collections/Chunk/definition";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/failCauseNow";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/failNow";
import * as tsplus_module_5 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_6 from "@effect/core/io/Effect/operations/foldCauseEffect";
/**
 * Exposes all parallel errors in a single call.
 *
 * @tsplus fluent ets/Effect parallelErrors
 */

export function parallelErrors(self, __tsplusTrace) {
  return tsplus_module_6.foldCauseEffect_(self, cause => {
    const errors = tsplus_module_2.from(tsplus_module_1.failures(cause));
    return errors.length === 0 ? tsplus_module_3.failCauseNow(cause, __tsplusTrace) : tsplus_module_4.failNow(errors, __tsplusTrace);
  }, tsplus_module_5.succeedNow, __tsplusTrace);
}
//# sourceMappingURL=parallelErrors.mjs.map