Message from JavaScript discussions

March 2018

— I'm not telling anyone to avoid using iterators, just avoid for..of without return or yield


You said it “implies side effects” which it does not, you have an idea that it is not possible to implement functional purity in that context, and I don’t know why this is

— I have seen many successful implementations using environment monads for instance, which exist just fine in a block without a return

Message permanent page

— Show me a pure functional use case of for..of without return or yield in the loop body

— Maybe sometime I will

— Hah

— Until you do I'll keep having misconceptions

— I would if I wasn’t half asleep on my phone, kind of feel like you don’t want to find this yourself

— Or well, make it rather, as it isn’t that difficult with the right infrastructure in place

— I can't imagine it

— I can't conceive of a possible scenario where it would be pure and at the same time not useless

— Well that’s pretty interesting to me and makes me curious about it