import * as tsplus_module_1 from "@tsplus/stdlib/collections/Chunk/isEmpty";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/unit";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/fail";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/partitionPar";
import * as tsplus_module_5 from "@effect/core/io/Effect/operations/flatMap";
/**
 * Feeds elements of type `A` to `f` in parallel and accumulates all errors,
 * discarding the successes.
 *
 * @tsplus static ets/Effect/Ops validateParDiscard
 */

export function validateParDiscard(as, f, __tsplusTrace) {
  return tsplus_module_5.flatMap_(tsplus_module_4.partitionPar(as, f, __tsplusTrace), ({
    tuple: [es, _]
  }) => tsplus_module_1.isEmpty(es) ? tsplus_module_2.unit : tsplus_module_3.fail(() => es, __tsplusTrace), __tsplusTrace);
}
//# sourceMappingURL=validateParDiscard.mjs.map