{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreidgkx6qoejawwpfvlnt2ouadi2plk6zr4bc6cunz5ztokgodv23ca",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mnuwbduhghe2"
},
"path": "/t/haskells-missing-mutable-reference-type/14248#post_10",
"publishedAt": "2026-06-09T18:53:36.000Z",
"site": "https://discourse.haskell.org",
"textContent": "tomjaguarpaw:\n\n> Why is it not “mutable from the user perspective”? The value of `x` “mutates” here, doesn’t it?\n\nIt’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.\n\nIn this regard it’s no more a mutation than `let y = (+2) 5`.\n\ntomjaguarpaw:\n\n> I’m not sure what “collecting all the references upfront” means. Can you elaborate?\n\nMy 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.\n\nEvery `contextual` declaration would then be a reservation for a seat at the table.",
"title": "Haskell's missing mutable reference type"
}