aivika-1.3: A multi-paradigm simulation library

MaintainerDavid Sorokin <>
Safe HaskellSafe-Inferred



Tested with: GHC 7.6.3

This module defines a light-weight and more fast version of an updatable reference that depends on the event queue but that doesn't supply with the signal notification.



data Ref a Source

The Ref type represents a mutable variable similar to the IORef variable but only dependent on the event queue, which allows synchronizing the reference with the model explicitly through the Event monad.

newRef :: a -> Simulation (Ref a)Source

Create a new reference.

readRef :: Ref a -> Event aSource

Read the value of a reference.

writeRef :: Ref a -> a -> Event ()Source

Write a new value into the reference.

modifyRef :: Ref a -> (a -> a) -> Event ()Source

Mutate the contents of the reference.