ArrayRef-0.1: Unboxed references, dynamic arrays and moreSource codeContentsIndex
Data.Ref.Universal
PortabilityHugs/GHC
Stabilityexperimental
MaintainerBulat Ziganshin <Bulat.Ziganshin@gmail.com>
Contents
Monad-independent interface for boxed references
Monad-independent interface for unboxed references
Description
Monad-independent interfaces for boxed and unboxed references
Synopsis
class Monad m => Ref m r | m -> r, r -> m where
newRef :: a -> m (r a)
readRef :: r a -> m a
writeRef :: r a -> a -> m ()
modifyRef
modifyRefM
class Monad m => URef m r | m -> r, r -> m where
newURef :: Unboxed a => a -> m (r a)
readURef :: Unboxed a => r a -> m a
writeURef :: Unboxed a => r a -> a -> m ()
modifyURef
modifyURefM
Monad-independent interface for boxed references
class Monad m => Ref m r | m -> r, r -> m whereSource
This class allows to create new boxed reference in monad-independent way (suitable for writing code that will work in IO, ST and other monads)
Methods
newRef :: a -> m (r a)Source
Create a new Ref with given initial value
readRef :: r a -> m aSource
Read the value of an Ref
writeRef :: r a -> a -> m ()Source
Write new value into an Ref
show/hide Instances
modifyRef
modifyRefM
Monad-independent interface for unboxed references
class Monad m => URef m r | m -> r, r -> m whereSource

Modify the contents of an Ref by applying pure function to it

Modify the contents of an Ref by applying monadic computation to it

This class allows to create new unboxed reference in monad-independent way (suitable for writing code that will work in IO, ST and other monads)

Methods
newURef :: Unboxed a => a -> m (r a)Source
Create a new URef with given initial value
readURef :: Unboxed a => r a -> m aSource
Read the value of an URef
writeURef :: Unboxed a => r a -> a -> m ()Source
Write new value into an URef
show/hide Instances
modifyURef
modifyURefM
Produced by Haddock version 2.4.2