aivika-experiment-5.2: Simulation experiments for the Aivika library

CopyrightCopyright (c) 2012-2017 David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell98

Simulation.Aivika.Trans.Experiment.Concurrent.MVar

Description

Tested with: GHC 8.0.1

The module defines helper functions for working with synchronized variable MVar.

Synopsis

Documentation

maybeReadMVarComp :: (MonadComp m, MonadIO m) => b -> (a -> m b) -> MVar (Maybe a) -> m b Source #

Like maybe but for the synchronized variable.

maybeReadMVarParameter :: (MonadComp m, MonadIO m) => b -> (a -> Parameter m b) -> MVar (Maybe a) -> Parameter m b Source #

Like maybeReadMVarComp but within the Parameter computation.

maybeReadMVarSimulation :: (MonadComp m, MonadIO m) => b -> (a -> Simulation m b) -> MVar (Maybe a) -> Simulation m b Source #

Like maybeReadMVarComp but within the Simulation computation.

maybeReadMVarDynamics :: (MonadComp m, MonadIO m) => b -> (a -> Dynamics m b) -> MVar (Maybe a) -> Dynamics m b Source #

Like maybeReadMVarComp but within the Dynamics computation.

maybeReadMVarEvent :: (MonadComp m, MonadIO m) => b -> (a -> Event m b) -> MVar (Maybe a) -> Event m b Source #

Like maybeReadMVarComp but within the Event computation.

maybeReadMVarProcess :: (MonadDES m, MonadIO m) => b -> (a -> Process m b) -> MVar (Maybe a) -> Process m b Source #

Like maybeReadMVarComp but within the Process computation.

maybePutMVarComp :: (MonadComp m, MonadIO m) => MVar (Maybe a) -> m a -> (a -> m b) -> m b Source #

Update the contents if the variable was empty and then return a result of applying the specified function to either the initial or current value.

maybePutMVarParameter :: (MonadComp m, MonadIO m) => MVar (Maybe a) -> Parameter m a -> (a -> Parameter m b) -> Parameter m b Source #

Like maybePutMVarComp but within the Parameter computation.

maybePutMVarSimulation :: (MonadComp m, MonadIO m) => MVar (Maybe a) -> Simulation m a -> (a -> Simulation m b) -> Simulation m b Source #

Like maybePutMVarComp but within the Simulation computation.

maybePutMVarDynamics :: (MonadComp m, MonadIO m) => MVar (Maybe a) -> Dynamics m a -> (a -> Dynamics m b) -> Dynamics m b Source #

Like maybePutMVarComp but within the Dynamics computation.

maybePutMVarEvent :: (MonadComp m, MonadIO m) => MVar (Maybe a) -> Event m a -> (a -> Event m b) -> Event m b Source #

Like maybePutMVarComp but within the Event computation.

maybePutMVarProcess :: (MonadDES m, MonadIO m) => MVar (Maybe a) -> Process m a -> (a -> Process m b) -> Process m b Source #

Like maybePutMVarComp but within the Process computation.