Haskell's missing mutable reference type

BurningWitness:

It’s mutating if you look at the flow imperatively, but that would be an implementation detail.

That’s a fine point of view. I don’t have a strong view on what “mutable” should mean, but I think it’s interesting to know that the fact that IORef is implemented by actually mutating the value stored in a piece of memory is also an implementation detail. According to The Key Monad it also has a completely pure implementation.

BurningWitness:

My naive assumption is that a feature like this would be implemented by having every worker thread carry around a table of these kinds of references, and the size of the table would be determined at compilation time.

Ah right, the size doesn’t have to be determined up front. It can grow dynamically.