Copyright | Copyright (c) 2009-2014, David Sorokin <david.sorokin@gmail.com> |
---|---|
License | BSD3 |
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Tested with: GHC 7.8.3
The module defines the SimulationT
monad transformer that represents a simulation run.
- data Simulation m a
- class SimulationLift t where
- liftSimulation :: MonadComp m => Simulation m a -> t m a
- runSimulation :: MonadComp m => Simulation m a -> Specs m -> m a
- runSimulations :: MonadComp m => Simulation m a -> Specs m -> Int -> [m a]
- catchSimulation :: (MonadComp m, Exception e) => Simulation m a -> (e -> Simulation m a) -> Simulation m a
- finallySimulation :: MonadComp m => Simulation m a -> Simulation m b -> Simulation m a
- throwSimulation :: (MonadComp m, Exception e) => e -> Simulation m a
- memoSimulation :: MonadComp m => Simulation m a -> Simulation m (Simulation m a)
Simulation
data Simulation m a Source
A value in the Simulation
monad represents a computation
within the simulation run.
MonadTrans Simulation | |
MonadCompTrans Simulation | |
ParameterLift Simulation | |
SimulationLift Simulation | |
MonadComp m => ResultComputing Simulation m | |
Monad m => Monad (Simulation m) | |
Functor m => Functor (Simulation m) | |
MonadFix m => MonadFix (Simulation m) | |
Applicative m => Applicative (Simulation m) | |
MonadIO m => MonadIO (Simulation m) |
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.
Memoization
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.