Copyright | Copyright (c) 2009-2017 David Sorokin <david.sorokin@gmail.com> |
---|---|
License | BSD3 |
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Tested with: GHC 8.0.1
The module defines the Dynamics
monad transformer representing a time varying polymorphic function.
- newtype Dynamics m a = Dynamics (Point m -> m a)
- class DynamicsLift t m where
- invokeDynamics :: Point m -> Dynamics m a -> m a
- runDynamicsInStartTime :: Dynamics m a -> Simulation m a
- runDynamicsInStopTime :: Dynamics m a -> Simulation m a
- runDynamicsInIntegTimes :: Monad m => Dynamics m a -> Simulation m [m a]
- runDynamicsInTime :: Double -> Dynamics m a -> Simulation m a
- runDynamicsInTimes :: Monad m => [Double] -> Dynamics m a -> Simulation m [m a]
- catchDynamics :: (MonadException m, Exception e) => Dynamics m a -> (e -> Dynamics m a) -> Dynamics m a
- finallyDynamics :: MonadException m => Dynamics m a -> Dynamics m b -> Dynamics m a
- throwDynamics :: (MonadException m, Exception e) => e -> Dynamics m a
- time :: Monad m => Dynamics m Double
- isTimeInteg :: Monad m => Dynamics m Bool
- integIteration :: Monad m => Dynamics m Int
- integPhase :: Monad m => Dynamics m Int
- traceDynamics :: Monad m => String -> Dynamics m a -> Dynamics m a
Dynamics
A value in the Dynamics
monad represents a polymorphic time varying function
defined in the whole spectrum of time values as a single entity. It is ideal for
numerical approximating integrals.
Monad m => DynamicsLift Dynamics m Source # | |
MonadDES m => ResultComputing Dynamics m Source # | |
(MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (Dynamics m (Vector e)) m Source # | |
(Ix i, Show i, MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (Dynamics m (Array i e)) m Source # | |
(MonadDES m, ResultItemable (ResultValue a), ResultItemable (ResultValue (TimingStats a))) => ResultProvider (Dynamics m (TimingCounter a)) m Source # | |
(MonadDES m, ResultItemable (ResultValue a), ResultItemable (ResultValue (SamplingStats a))) => ResultProvider (Dynamics m (SamplingCounter a)) m Source # | |
(MonadDES m, ResultItemable (ResultValue a)) => ResultProvider (Dynamics m a) m Source # | |
class DynamicsLift t m where Source #
A type class to lift the Dynamics
computations into other computations.
liftDynamics :: Dynamics m a -> t m a Source #
Lift the specified Dynamics
computation into another computation.
Monad m => DynamicsLift Dynamics m Source # | |
Monad m => DynamicsLift Composite m Source # | |
MonadDES m => DynamicsLift Cont m Source # | |
MonadDES m => DynamicsLift Process m Source # | |
runDynamicsInStartTime :: Dynamics m a -> Simulation m a Source #
Run the Dynamics
computation in the initial time point.
runDynamicsInStopTime :: Dynamics m a -> Simulation m a Source #
Run the Dynamics
computation in the final time point.
runDynamicsInIntegTimes :: Monad m => Dynamics m a -> Simulation m [m a] Source #
Run the Dynamics
computation in all integration time points.
runDynamicsInTime :: Double -> Dynamics m a -> Simulation m a Source #
Run the Dynamics
computation in the specified time point.
runDynamicsInTimes :: Monad m => [Double] -> Dynamics m a -> Simulation m [m a] Source #
Run the Dynamics
computation in the specified time points.
Error Handling
catchDynamics :: (MonadException m, Exception e) => Dynamics m a -> (e -> Dynamics m a) -> Dynamics m a Source #
Exception handling within Dynamics
computations.
finallyDynamics :: MonadException m => Dynamics m a -> Dynamics m b -> Dynamics m a Source #
A computation with finalization part like the finally
function.
throwDynamics :: (MonadException m, Exception e) => e -> Dynamics m a Source #
Like the standard throw
function.
Simulation Time
integIteration :: Monad m => Dynamics m Int Source #
Return the integration iteration closest to the current simulation time.
integPhase :: Monad m => Dynamics m Int Source #
Return the integration phase for the current simulation time.
It is (-1)
for non-integration time points.
Debugging
traceDynamics :: Monad m => String -> Dynamics m a -> Dynamics m a Source #
Show the debug message with the current simulation time.
Orphan instances
MonadTrans Dynamics Source # | |
Monad m => MonadCompTrans Dynamics m Source # | |
Monad m => ParameterLift Dynamics m Source # | |
Monad m => SimulationLift Dynamics m Source # | |
Monad m => Monad (Dynamics m) Source # | |
Functor m => Functor (Dynamics m) Source # | |
MonadFix m => MonadFix (Dynamics m) Source # | |
Applicative m => Applicative (Dynamics m) Source # | |
MonadIO m => MonadIO (Dynamics m) Source # | |
MonadException m => MonadThrow (Dynamics m) Source # | |
MonadException m => MonadCatch (Dynamics m) Source # | |
(MonadException m, MonadMask m) => MonadMask (Dynamics m) Source # | |
(Floating a, Monad m) => Floating (Dynamics m a) Source # | |
(Fractional a, Monad m) => Fractional (Dynamics m a) Source # | |
(Num a, Monad m) => Num (Dynamics m a) Source # | |