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

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

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

  return tsplus_module_8.none;
}
//# sourceMappingURL=collectAll.mjs.map