import * as tsplus_module_1 from "@tsplus/stdlib/data/Function";
import * as tsplus_module_2 from "@effect/core/stm/STM/operations/either";
import * as tsplus_module_3 from "@effect/core/stm/STM/operations/forEach";
import * as tsplus_module_4 from "@effect/core/stm/STM/operations/suspend";
import * as tsplus_module_5 from "@effect/core/stm/STM/operations/map";
import { partitionMap } from "@effect/core/io/Effect/operations/_internal/partitionMap";
/**
 * Feeds elements of type `A` to a function `f` that returns an effect.
 * Collects all successes and failures in a tupled fashion.
 *
 * @tsplus static ets/STM/Ops partition
 */

export function partition(as, f) {
  return tsplus_module_5.map_(tsplus_module_4.suspend(() => tsplus_module_3.forEach(as, a => tsplus_module_2.either(f(a)))), chunk => partitionMap(chunk, tsplus_module_1.identity));
}
//# sourceMappingURL=partition.mjs.map