/** * Sequentially zips the this result with the specified result. Combines both * `Cause` when both effects fail. * * @tsplus static effect/core/io/Effect.Aspects validate * @tsplus pipeable effect/core/io/Effect validate */ export function validateNow(that: Effect) { return (self: Effect): Effect => self.validateWith(that, (a, b) => [a, b] as const) } /** * Feeds elements of type `A` to `f` and accumulates 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 `partition`. * * @tsplus static effect/core/io/Effect.Ops validate */ export function validate( as: Collection, f: (a: A) => Effect ): Effect, Chunk> { return Effect.partition(as, f).flatMap(([es, bs]) => es.isEmpty ? Effect.succeed(Chunk.from(bs)) : Effect.fail(es) ) }