/** * Composes the specified generators to create a cartesian product of elements * with the specified function. * * @tsplus static effect/core/testing/Gen.Ops collectAll */ export function collectAll(gens: Collection>): Gen> { return gens.reduce( Gen.constant(List.empty()) as Gen>, (acc, curr) => acc.zipWith(curr, (list, a) => list.prepend(a)) ).map((list) => list.reverse) }