Haskell foldl’ poor performance with (++)

There is much confusion about this issue. The usual reason given is that “repeatedly appending at end of list requires repeated traversals of list and is thus O(n^2)“. But it would only be so simple under strict evaluation. Under lazy evaluation everything is supposed to be delayed, so it begs the question whether there actually … Read more