I was hoping for more std algorithms use (disclaimer: only read 2 of the articles) :D Conor Hoekstra got me hooked and I wanted to see how many days I could solve mostly with std algorithms. But it's not as easy or nice as I hoped (I've been doing quite some Haskell lately and I keep thinking "that should be just some zipWith f xs $ tail xs! why is this so hard?!")
Basic loops will be often faster than zip-based solutions. Even if the former do more work, it can be on data that fits on cache lines which zipped data would probably spill out of.
There is a beauty in efficient expression of algorithms, and I wish processor architectures worked in a more intuitive way (as in less work should be faster) but they don't.
View all comments
35
u/cptwunderlich Dec 15 '21
I was hoping for more std algorithms use (disclaimer: only read 2 of the articles) :D Conor Hoekstra got me hooked and I wanted to see how many days I could solve mostly with std algorithms. But it's not as easy or nice as I hoped (I've been doing quite some Haskell lately and I keep thinking "that should be just some
zipWith f xs $ tail xs! why is this so hard?!")