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

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