IOSpec-0.1.1: A pure specification of the IO monad.Source codeContentsIndex
Test.IOSpec.IORef
Contents
The IOState monad
Manipulation of IORefs
Description
A pure specification of mutable variables.
Synopsis
data IOState a
runIOState :: IOState a -> a
data IORef a
newIORef :: Typeable a => a -> IOState (IORef a)
readIORef :: Typeable a => IORef a -> IOState a
writeIORef :: Typeable a => IORef a -> a -> IOState ()
modifyIORef :: Typeable a => IORef a -> (a -> a) -> IOState ()
The IOState monad
data IOState a Source
The IOState monad
show/hide Instances
runIOState :: IOState a -> aSource
The runIOState function executes a computation in the IOState monad.
Manipulation of IORefs
data IORef a Source
A mutable variable in the IOState monad
newIORef :: Typeable a => a -> IOState (IORef a)Source
The newIORef function creates a new mutable variable.
readIORef :: Typeable a => IORef a -> IOState aSource
The readIORef function reads the value stored in a mutable variable.
writeIORef :: Typeable a => IORef a -> a -> IOState ()Source
The writeIORef function overwrites the value stored in an IORef.
modifyIORef :: Typeable a => IORef a -> (a -> a) -> IOState ()Source
The modifyIORef function applies a function to the value stored in and IORef.
Produced by Haddock version 2.6.0