Stability | experimental |
---|---|
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Safe Haskell | Safe-Inferred |
Tested with: GHC 7.8.3
The module defines the Simulation
monad that represents a simulation run.
- data Simulation a
- class SimulationLift m where
- liftSimulation :: Simulation a -> m a
- runSimulation :: Simulation a -> Specs -> IO a
- runSimulations :: Simulation a -> Specs -> Int -> [IO a]
- catchSimulation :: Exception e => Simulation a -> (e -> Simulation a) -> Simulation a
- finallySimulation :: Simulation a -> Simulation b -> Simulation a
- throwSimulation :: Exception e => e -> Simulation a
- memoSimulation :: Simulation a -> Simulation (Simulation a)
Simulation
data Simulation a Source
A value in the Simulation
monad represents a computation
within the simulation run.
Monad Simulation | |
Functor Simulation | |
MonadFix Simulation | |
Applicative Simulation | |
MonadIO Simulation | |
ParameterLift Simulation | |
SimulationLift Simulation | |
ResultComputing Simulation |
class SimulationLift m whereSource
A type class to lift the simulation computations to other computations.
liftSimulation :: Simulation a -> m aSource
Lift the specified Simulation
computation to another computation.
runSimulation :: Simulation a -> Specs -> IO aSource
Run the simulation using the specified specs.
runSimulations :: Simulation a -> Specs -> Int -> [IO a]Source
Run the given number of simulations using the specified specs,
where each simulation is distinguished by its index simulationIndex
.
Error Handling
catchSimulation :: Exception e => Simulation a -> (e -> Simulation a) -> Simulation aSource
Exception handling within Simulation
computations.
finallySimulation :: Simulation a -> Simulation b -> Simulation aSource
A computation with finalization part like the finally
function.
throwSimulation :: Exception e => e -> Simulation aSource
Like the standard throw
function.
Memoization
memoSimulation :: Simulation a -> Simulation (Simulation a)Source
Memoize the Simulation
computation, always returning the same value
within a simulation run.