import * as tsplus_module_1 from "@tsplus/stdlib/data/Function";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/either";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/excl-forEach";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/suspendSucceed";
import * as tsplus_module_5 from "@effect/core/io/Effect/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/Effect/Ops partition
 */

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