monadIO-0.9.1.0: Overloading of concurrency variables

PortabilityIO
Stabilityexperimental
MaintainerJohn Launchbury, john@galois.com

Data.IORef.MonadIO

Description

Overloads the standard operations on IORefs, as defined in Data.IORef. This module is name-for-name swappable with Data.IORef unless ghc-specific operations like weak pointers are used.

The standard operations on IORef (such as newIORef, or modifyIORef) are overloaded over the MonadIO class. A monad m is declared an instance of MonadIO by defining a function

 liftIO :: IO a -> m a

Synopsis

Documentation

class Monad m => MonadIO m where

Methods

liftIO :: IO a -> m a

Instances

data IORef a

A mutable variable in the IO monad

Instances

newIORef :: MonadIO io => a -> io (IORef a)Source

readIORef :: MonadIO io => IORef a -> io aSource

writeIORef :: MonadIO io => IORef a -> a -> io ()Source

modifyIORef :: MonadIO io => IORef a -> (a -> a) -> io ()Source

atomicModifyIORef :: MonadIO io => IORef a -> (a -> (a, b)) -> io bSource