3 ms·
> As long as you no longer refer to the old instance, this is as efficient as a mutable array. On paper this is true, in reality though it probably is not. Im
by misja111 3y ago
> As long as you no longer refer to the old instance, this is as efficient as a mutable array.
On paper this is true, in reality though it probably is not. Immutable Haskell arrays are implemented with pointers, mutable arrays are implemented as contiguous memory allocations, so they have great cache locality.