Stability | experimental |
---|---|
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Safe Haskell | None |
Tested with: GHC 7.0.3
This module defines a variable that is bound to the event queue and that keeps the history of changes storing the values in an unboxed array.
- data UVar a
- uvarQueue :: UVar a -> EventQueue
- uvarChanged :: UVar a -> Signal a
- uvarChanged_ :: UVar a -> Signal ()
- newUVar :: MArray IOUArray a IO => EventQueue -> a -> Simulation (UVar a)
- readUVar :: MArray IOUArray a IO => UVar a -> Dynamics a
- writeUVar :: MArray IOUArray a IO => UVar a -> a -> Dynamics ()
- modifyUVar :: MArray IOUArray a IO => UVar a -> (a -> a) -> Dynamics ()
- freezeUVar :: MArray IOUArray a IO => UVar a -> Dynamics (Array Int Double, Array Int a)
Documentation
A version of the Var
type which uses an unboxed array to store the values
in time points. You should prefer this type whenever possible.
uvarQueue :: UVar a -> EventQueueSource
Return the bound event queue.
uvarChanged :: UVar a -> Signal aSource
Return a signal that notifies about every change of the variable state.
uvarChanged_ :: UVar a -> Signal ()Source
Return a signal that notifies about every change of the variable state.
newUVar :: MArray IOUArray a IO => EventQueue -> a -> Simulation (UVar a)Source
Create a new variable bound to the specified event queue.
readUVar :: MArray IOUArray a IO => UVar a -> Dynamics aSource
Read the value of a variable, forcing the bound event queue to raise the events in case of need.
writeUVar :: MArray IOUArray a IO => UVar a -> a -> Dynamics ()Source
Write a new value into the variable.