Module Data.IORef

Library with some useful extensions to the IO monad.

Category
general
Author
Michael Hanus
Version
January 2017

Exported Datatypes: IORef

Exported Functions: modifyIORef, newIORef, readIORef, writeIORef


Exported Datatypes


data IORef a

Mutable variables containing values of some type. The values are not evaluated when they are assigned to an IORef.


Exported Functions


newIORef :: a -> IO (IORef a)  Deterministic 

Creates a new IORef with an initial value.

Further infos:
  • externally defined

readIORef :: IORef a -> IO a  Deterministic 

Reads the current value of an IORef.


writeIORef :: IORef a -> a -> IO ()  Deterministic 

Updates the value of an IORef.


modifyIORef :: IORef a -> (a -> a) -> IO ()  Deterministic 

Modify the value of an IORef.