Message from JavaScript discussions

March 2018

— Differentia?


You can use the API just fine un a pure functional context, their purpose is to provide a pure functional view of a data structure

— Iterators in general

— Well, I think it's easy to do impure things in a for..of by accident

— And usually you would just need map/reduce/filter

— It is an iterator advancer

— There is a technical term for it which flew out of my brain lol

— Yes, but the same things I've listed pretty much apply to any block as well

— Yield or return should be contained within any block

— When you need a generic serialization interface, you can use the iterator API with for/of and build polymorphic algorithms, too... it’s a standard for an interface all data structures should implement if possible

Message permanent page

— 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

Message permanent page