Local accumulators for cleaner comprehensions

Correct, but it requires actual mutable state, has worse performance, and has a less friendly user experience as the compiler cannot tell you when you are accessing something that could have been “dealocated”. So the question is: solving this problem in a faster, immutable, and with better dx worth the syntax additions?

Yes. They can be used anywhere a variable would be used.

7 Likes