/** * 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/stm/STM.Ops validate */ export function validate( as: Collection, f: (a: A) => STM ): STM, Chunk> { return STM.partition(as, f).flatMap(([es, bs]) => es.isEmpty ? STM.succeed(Chunk.from(bs)) : STM.fail(es) ) }