/** * Evaluate each effect in the structure from left to right, collecting the * the successful values and discarding the empty cases. For a parallel version, see `collectPar`. * * @tsplus static effect/core/io/Effect.Ops collect */ export function collect( as: Collection, f: (a: A) => Effect, B> ): Effect> { return Effect.forEach(as, (a) => f(a).unsome).map((chunk) => chunk.compact) }