import * as tsplus_module_1 from "@tsplus/stdlib/collections/List/from";
import * as tsplus_module_2 from "@effect/core/io/Exit/operations/map";
import * as tsplus_module_3 from "@tsplus/stdlib/collections/List/prepend";
import * as tsplus_module_4 from "@effect/core/io/Cause/definition";
import * as tsplus_module_5 from "@effect/core/io/Exit/operations/zipWith";
import * as tsplus_module_6 from "@tsplus/stdlib/collections/Collection/functions";
import * as tsplus_module_7 from "@tsplus/stdlib/data/Maybe/definition";
/**
 * @tsplus static ets/Exit/Ops collectAllPar
 */

export function collectAllPar(exits) {
  const head = exits[Symbol.iterator]().next();

  if (!head.done && head.value) {
    return tsplus_module_7.some(tsplus_module_6.reduce_(tsplus_module_6.skip_(exits, 1), tsplus_module_2.map_(head.value, a => tsplus_module_1.make(a)), (acc, el) => tsplus_module_5.zipWith_(acc, el, (list, a) => tsplus_module_3.prepend_(list, a), tsplus_module_4.combinePar)));
  }

  return tsplus_module_7.none;
}
//# sourceMappingURL=collectAllPar.mjs.map