# Haskell's missing mutable reference type

**URL:** <https://discourse.haskell.org/t/haskells-missing-mutable-reference-type/14248>\
**Category:** Links\
**Created:** [June 9, 2026, 9:32am UTC](https://discourse.haskell.org/t/haskells-missing-mutable-reference-type/14248 "2026-06-09T09:32:56Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![BurningWitness](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/burningwitness/32/3665_2.png) [@BurningWitness](https://discourse.haskell.org/u/BurningWitness)\
**Post date:** [June 9, 2026, 4:51pm UTC](https://discourse.haskell.org/t/haskells-missing-mutable-reference-type/14248/8 "2026-06-09T16:51:34Z")

</div>

Okay, I had to spend 40 minutes figuring out what this is, and I’m still not sure.

Am I correct to understand that the problem you’re looking to solve is that of a user-definable implicit global context, which can be adjusted locally, e.g.

```haskell
overriding :: Contextual a -> (a -> a) -> (forall b. IO b -> IO b) -- deeply magical

contextual x :: Contextual Int -- still magical
contextual x = 5

foo = do
  a <- getContextual x
  print a

--- Library user doesn't get to implement anything above this line

-- Prints number 7
main = overriding x (+2) foo

```

I assumed if a feature like this were to exist it’d be on the compiler to collect all the “contextual” references upfront. This wouldn’t be mutable from user perspective, so I wouldn’t bring up `IORef` at all when talking about it.

---

_[View the full topic](https://discourse.haskell.org/t/haskells-missing-mutable-reference-type/14248)._
