/** * Returns an effect that executes both this effect and the specified effect, * in parallel. Combines both Cause` when both effects fail. * * @tsplus static effect/core/io/Effect.Aspects validatePar * @tsplus pipeable effect/core/io/Effect validatePar */ export function validateParNow(that: Effect) { return (self: Effect): Effect => self.validateWithPar(that, (a, b) => [a, b] as const) } /** * Feeds elements of type `A` to `f `and accumulates, in parallel, all errors * in error channel or successes in success channel. * * This combinator is lossy meaning that if there are errors all successes * will be lost. To retain all information please use [[partitionPar]]. * * @tsplus static effect/core/io/Effect.Ops validatePar */ export function validatePar( as: Collection, f: (a: A) => Effect ): Effect, Chunk> { return Effect.partitionPar(as, f).flatMap(([es, bs]) => es.isEmpty ? Effect.succeed(Chunk.from(bs)) : Effect.fail(es) ) }