Re:It never makes sense to use foldl on lists in Haskell (2019)
by fiddlerwoaroof on Saturday March 21, 2020 @01:49PM
(#22648293)
In most of the cases where I’m using a list or array, I’m adding items to one end and then iterating forward over the structure a handful of times.
But, yeah, if you’re relying heavily on random access, pick a vector/array or some kind of tree/hash table.
Now sure, if it’s small and you’re only creating then reading it once then that’s fine. But, you’re assumptions need to be accurate or you just created a problem.