aivika-transformers-2.0: Transformers for the Aivika simulation library

CopyrightCopyright (c) 2009-2014, David Sorokin <>
MaintainerDavid Sorokin <>
Safe HaskellSafe-Inferred




Tested with: GHC 7.8.3

The module defines the SimulationT monad transformer that represents a simulation run.



class SimulationLift t where Source

A type class to lift the simulation computations into other computations.


liftSimulation :: MonadComp m => Simulation m a -> t m a Source

Lift the specified Simulation computation into another computation.

runSimulation :: MonadComp m => Simulation m a -> Specs m -> m a Source

Run the simulation using the specified specs.

runSimulations :: MonadComp m => Simulation m a -> Specs m -> Int -> [m a] Source

Run the given number of simulations using the specified specs, where each simulation is distinguished by its index simulationIndex.

Error Handling

catchSimulation :: (MonadComp m, Exception e) => Simulation m a -> (e -> Simulation m a) -> Simulation m a Source

Exception handling within Simulation computations.

finallySimulation :: MonadComp m => Simulation m a -> Simulation m b -> Simulation m a Source

A computation with finalization part like the finally function.

throwSimulation :: (MonadComp m, Exception e) => e -> Simulation m a Source

Like the standard throw function.


memoSimulation :: MonadComp m => Simulation m a -> Simulation m (Simulation m a) Source

Memoize the Simulation computation, always returning the same value within a simulation run.