Copyright | Copyright (c) 2009-2015, David Sorokin <david.sorokin@gmail.com> |
---|---|
License | BSD3 |
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
Tested with: GHC 7.10.1
This module defines a plain and more fast version of an updatable reference that depends on the event queue but that doesn't supply with the signal notification.
Documentation
class Monad m => MonadRef m where Source
A monad within which we can create mutable references.
newRef :: a -> Simulation m (Ref m a) Source
Create a new reference.
readRef :: Ref m a -> Event m a Source
Read the value of a reference.
writeRef :: Ref m a -> a -> Event m () Source
Write a new value into the reference.
modifyRef :: Ref m a -> (a -> a) -> Event m () Source
Mutate the contents of the reference.
equalRef :: Ref m a -> Ref m a -> Bool Source
Compare two references for equality.
class MonadRef m => MonadRef0 m where Source
A kind of reference that can be created within more low level computation than Simulation
.
newRef0 :: a -> m (Ref m a) Source
Create a new reference within more low level computation than Simulation
.