News for hackers. Stuff that matters.
Re:Currying vs. Partial Application (2015) by przemo_li on Wednesday September 20, 2017 @05:08AM (#15291856)
If you stopped using native loops / forEach how do you handle iteration for the sake of creating side effects?

+1 for including take/drop alongside map/reduse/filter

Re:Currying vs. Partial Application (2015) by splintercell on Thursday September 21, 2017 @11:35AM (#15304493)
In my experience, there is almost never a need for creating a loop on an array purely for the sake of side effect.

For instance, if you want to write something on the log, then loop and collect everything into a single array (using map) and then perform the side effect with a single command (which is a lot more performant in most cases).

For asynchronous side effects, create an array of promises using a map, and then run a Promise.all() on that array if you need to resolve all of them.

But again, if your experience is different or in your requirements, it is not possible to create a map/reduce/filter transoformation for side effects, then I'd love to hear about it.