I feel that scoping is orthogonal to comprehensions. Mixing them together results in special cases. We see now in for-comprehensions that certain syntactic constructs are illegal, e.g. you can’t do:
In most cases, yes. But I still occasionally run into the case of wanting to stick a (collections.breakout) at the end of a comprehension so that the types get massaged into the correct shape.
Some combination of SIP-12 (as in dotty), changing the parse rules to use those of better-monadic-for (is this in dotty yet?), and the 2.13 collections rewrite should make this problem go away
No, and this won’t happen until someone writes a SIP for it (and other changes to for-comprehension that can achieve consensus), we’re waiting for the community to do that.