Artem
We had a bug before when GHC shared the array value and we sorted a random array only on the first iteration, and all the rest worked on a sorted array. @vidsinghal fixed it with a clever pre allocation strategy. Unfortunately, in my experiments this brings a certain performance cost (probably because GC has more stuff to care about throughout the execution). It'd be good to find a way to avoid that (but not regress back to sharing).
Relevant code is benchOnArrays and its call site.
Copied from https://github.com/michaelborkowski/lh-array-sort/issues/41.