Module Data.IORef

Library with some useful extensions to the IO monad.

Author: Michael Hanus

Version: January 2017

Summary of exported operations:

newIORef :: a -> IO (IORef a)  Deterministic 
Creates a new IORef with an initial value.
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.

Exported datatypes:


IORef

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

Constructors:


Exported operations:

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.