import * as tsplus_module_1 from "@effect/core/io/Effect/operations/succeed";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/zipWith";
import * as tsplus_module_3 from "@tsplus/stdlib/collections/Collection/functions";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/suspendSucceed";
/**
 * Merges an `Collection<Effect<R, E, A>>` to a single `Effect<R, E, B>`, working
 * sequentially.
 *
 * @tsplus static ets/Effect/Ops mergeAll
 */

export function mergeAll(as, zero, f, __tsplusTrace) {
  return tsplus_module_4.suspendSucceed(() => tsplus_module_3.reduce_(as(), tsplus_module_1.succeed(zero, __tsplusTrace), (acc, a) => tsplus_module_2.zipWith_(acc, () => a, f, __tsplusTrace)), __tsplusTrace);
}
//# sourceMappingURL=mergeAll.mjs.map