Haskell's missing mutable reference type

tomjaguarpaw:

Why is it not “mutable from the user perspective”? The value of x “mutates” here, doesn’t it?

It’s mutating if you look at the flow imperatively, but that would be an implementation detail. I instead think of x as a stack of changes over the initial value; no matter what I do, upon reaching the end of an overriding function x will be exactly the same as it was immediately before entering it.

In this regard it’s no more a mutation than let y = (+2) 5.

tomjaguarpaw:

I’m not sure what “collecting all the references upfront” means. Can you elaborate?

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.

Every contextual declaration would then be a reservation for a seat at the table.