TypeCompose-0.6.0: Type composition classes & instances

PortabilityMPTC
Stabilityexperimental
Maintainerconal@conal.net

Data.RefMonad

Description

Monads with references, taken from John Hughes's Global Variables in Haskell (http://citeseer.ist.psu.edu/473734.html).

Synopsis

Documentation

class Monad m => RefMonad m r | m -> r whereSource

Class of monads with references.

Methods

newRef :: a -> m (r a)Source

readRef :: r a -> m aSource

writeRef :: r a -> a -> m ()Source

Instances

modifyRef :: RefMonad m r => r a -> (a -> a) -> m ()Source

Change the contents of a ref