I like the idea of improving the interoperability between iterators and generators a lot. I also agree with your point that this would be best done by making
Generator<Yield=T, _> and
Iterator<T> as equivalent as possible in the eye of the type system.
I would strengthen the point that Generator -> Iterator conversion and Iterator -> Generator conversion are both very important. We have a rather large body of Iterator-based code (standard Iterator methods, itertools, rayon, etc…), which should not need to be rewritten in order to be able to consume generators. Similarly, iterators should be usable in any place where generators are expected in order to ease adoption of generators in existing iterator-based codebases.
I am less sure about the proposed for loop changes. It would make for loops more special with respect to “raw” loop statements, since
break value; would be much more usable with the later than with the former. That is because in the raw loop case, the user controls the type of the loop return value, whereas in the for loop case, the underlying iterator/generator type controls it. I’m not sure how much of a problem that would be in practice, though, and the proposed use cases do look pretty nice.