IOSpec-0.2.1: A pure specification of the IO monad.Source codeContentsIndex
Test.IOSpec.IORef
Contents
The IORefS spec
Manipulation and creation of IORefs
Description
A pure specification of mutable variables.
Synopsis
data IORefS a
data IORef a
newIORef :: (Typeable a, IORefS :<: f) => a -> IOSpec f (IORef a)
readIORef :: (Typeable a, IORefS :<: f) => IORef a -> IOSpec f a
writeIORef :: (Typeable a, IORefS :<: f) => IORef a -> a -> IOSpec f ()
modifyIORef :: (Typeable a, IORefS :<: f) => IORef a -> (a -> a) -> IOSpec f ()
The IORefS spec
data IORefS a Source
An expression of type IOSpec IORefS a corresponds to an IO computation that uses mutable references and returns a value of type a.
show/hide Instances
Manipulation and creation of IORefs
data IORef a Source
A mutable variable storing a value of type a. Note that the types stored by an IORef are assumed to be Typeable.
newIORef :: (Typeable a, IORefS :<: f) => a -> IOSpec f (IORef a)Source
The newIORef function creates a new mutable variable.
readIORef :: (Typeable a, IORefS :<: f) => IORef a -> IOSpec f aSource
The readIORef function reads the value stored in a mutable variable.
writeIORef :: (Typeable a, IORefS :<: f) => IORef a -> a -> IOSpec f ()Source
The writeIORef function overwrites the value stored in a mutable variable.
modifyIORef :: (Typeable a, IORefS :<: f) => IORef a -> (a -> a) -> IOSpec f ()Source
The modifyIORef function applies a function to the value stored in and IORef.
Produced by Haddock version 2.4.2