IORef package:unliftio

Unlifted Data.IORef.
A mutable variable in the IO monad.
>>> import Data.IORef

>>> r <- newIORef 0

>>> readIORef r
0

>>> writeIORef r 1

>>> readIORef r
1

>>> atomicWriteIORef r 2

>>> readIORef r
2

>>> modifyIORef' r (+ 1)

>>> readIORef r
3

>>> atomicModifyIORef' r (\a -> (a + 1, ()))

>>> readIORef r
4
See also STRef and MVar.
Unlifted mkWeakIORef.
Lifted modifyIORef.
Lifted modifyIORef'.
Lifted newIORef.
Lifted readIORef.
Lifted writeIORef.