It should transform a validation for a generator into a generator of validations: if the given validation is a failure, the generator produces that failure value; if the given validation is a success, the generator produces success values.
public static <E, A> Gen<Validation<E, A>> sequence(final Validation<E, Gen<A>> gv) {
return gen(i -> r -> gv.map(g -> g.gen(i, r)));
}