External Publication
Visit Post

Haskell's missing mutable reference type

Haskell Community [Unofficial] June 10, 2026
Source

I’m still not quite sure what you mean. Yes, withIOScopedRef in particular, and IOScopedRef in general, is a feature I am arguing for! Part of its essential behaviour is to allow references to be allocated dynamically, just like an essential feature of IORef is that they can be allocated dynamically.

But suppose I had your contextual. I could define

contextual vault :: Contextual Vault
contextual vault = Vault.empty

to reconcile my interface with your implementation, couldn’t I?

(This is essentially what A reference implementation of IOScopedRef suggests: one global contextual variable, which is a vault.)

Discussion in the ATmosphere

Loading comments...