aivika-transformers-6.1: Transformers for the Aivika simulation library
CopyrightCopyright (c) 2009-2017 David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Simulation.Aivika.Trans.Internal.Dynamics

Description

Tested with: GHC 8.0.1

The module defines the Dynamics monad transformer representing a time varying polymorphic function.

Synopsis

Dynamics

newtype Dynamics m a Source #

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.

Constructors

Dynamics (Point m -> m a) 

Instances

Instances details
MonadTrans Dynamics Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

lift :: Monad m => m a -> Dynamics m a #

Monad m => MonadCompTrans Dynamics m Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

liftComp :: m a -> Dynamics m a Source #

Monad m => DynamicsLift Dynamics m Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

liftDynamics :: Dynamics m a -> Dynamics m a Source #

Monad m => ParameterLift Dynamics m Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

liftParameter :: Parameter m a -> Dynamics m a Source #

Monad m => SimulationLift Dynamics m Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

MonadDES m => ResultComputing Dynamics m Source # 
Instance details

Defined in Simulation.Aivika.Trans.Results

Monad m => MonadFail (Dynamics m) Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

fail :: String -> Dynamics m a #

MonadFix m => MonadFix (Dynamics m) Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

mfix :: (a -> Dynamics m a) -> Dynamics m a #

MonadIO m => MonadIO (Dynamics m) Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

liftIO :: IO a -> Dynamics m a #

Applicative m => Applicative (Dynamics m) Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

pure :: a -> Dynamics m a #

(<*>) :: Dynamics m (a -> b) -> Dynamics m a -> Dynamics m b #

liftA2 :: (a -> b -> c) -> Dynamics m a -> Dynamics m b -> Dynamics m c #

(*>) :: Dynamics m a -> Dynamics m b -> Dynamics m b #

(<*) :: Dynamics m a -> Dynamics m b -> Dynamics m a #

Functor m => Functor (Dynamics m) Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

fmap :: (a -> b) -> Dynamics m a -> Dynamics m b #

(<$) :: a -> Dynamics m b -> Dynamics m a #

Monad m => Monad (Dynamics m) Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

(>>=) :: Dynamics m a -> (a -> Dynamics m b) -> Dynamics m b #

(>>) :: Dynamics m a -> Dynamics m b -> Dynamics m b #

return :: a -> Dynamics m a #

MonadException m => MonadCatch (Dynamics m) Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

catch :: Exception e => Dynamics m a -> (e -> Dynamics m a) -> Dynamics m a #

(MonadException m, MonadMask m) => MonadMask (Dynamics m) Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

mask :: ((forall a. Dynamics m a -> Dynamics m a) -> Dynamics m b) -> Dynamics m b #

uninterruptibleMask :: ((forall a. Dynamics m a -> Dynamics m a) -> Dynamics m b) -> Dynamics m b #

generalBracket :: Dynamics m a -> (a -> ExitCase b -> Dynamics m c) -> (a -> Dynamics m b) -> Dynamics m (b, c) #

MonadException m => MonadThrow (Dynamics m) Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

throwM :: Exception e => e -> Dynamics m a #

(Floating a, Monad m) => Floating (Dynamics m a) Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

pi :: Dynamics m a #

exp :: Dynamics m a -> Dynamics m a #

log :: Dynamics m a -> Dynamics m a #

sqrt :: Dynamics m a -> Dynamics m a #

(**) :: Dynamics m a -> Dynamics m a -> Dynamics m a #

logBase :: Dynamics m a -> Dynamics m a -> Dynamics m a #

sin :: Dynamics m a -> Dynamics m a #

cos :: Dynamics m a -> Dynamics m a #

tan :: Dynamics m a -> Dynamics m a #

asin :: Dynamics m a -> Dynamics m a #

acos :: Dynamics m a -> Dynamics m a #

atan :: Dynamics m a -> Dynamics m a #

sinh :: Dynamics m a -> Dynamics m a #

cosh :: Dynamics m a -> Dynamics m a #

tanh :: Dynamics m a -> Dynamics m a #

asinh :: Dynamics m a -> Dynamics m a #

acosh :: Dynamics m a -> Dynamics m a #

atanh :: Dynamics m a -> Dynamics m a #

log1p :: Dynamics m a -> Dynamics m a #

expm1 :: Dynamics m a -> Dynamics m a #

log1pexp :: Dynamics m a -> Dynamics m a #

log1mexp :: Dynamics m a -> Dynamics m a #

(Num a, Monad m) => Num (Dynamics m a) Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

(+) :: Dynamics m a -> Dynamics m a -> Dynamics m a #

(-) :: Dynamics m a -> Dynamics m a -> Dynamics m a #

(*) :: Dynamics m a -> Dynamics m a -> Dynamics m a #

negate :: Dynamics m a -> Dynamics m a #

abs :: Dynamics m a -> Dynamics m a #

signum :: Dynamics m a -> Dynamics m a #

fromInteger :: Integer -> Dynamics m a #

(Fractional a, Monad m) => Fractional (Dynamics m a) Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

(/) :: Dynamics m a -> Dynamics m a -> Dynamics m a #

recip :: Dynamics m a -> Dynamics m a #

fromRational :: Rational -> Dynamics m a #

(MonadDES m, ResultItemable (ResultValue a), ResultItemable (ResultValue (SamplingStats a))) => ResultProvider (Dynamics m (SamplingCounter a)) m Source # 
Instance details

Defined in Simulation.Aivika.Trans.Results

(MonadDES m, ResultItemable (ResultValue a), ResultItemable (ResultValue (TimingStats a))) => ResultProvider (Dynamics m (TimingCounter a)) m Source # 
Instance details

Defined in Simulation.Aivika.Trans.Results

(Ix i, Show i, MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (Dynamics m (Array i e)) m Source # 
Instance details

Defined in Simulation.Aivika.Trans.Results

(MonadDES m, ResultItemable (ResultValue [e])) => ResultProvider (Dynamics m (Vector e)) m Source # 
Instance details

Defined in Simulation.Aivika.Trans.Results

(MonadDES m, ResultItemable (ResultValue a)) => ResultProvider (Dynamics m a) m Source # 
Instance details

Defined in Simulation.Aivika.Trans.Results

class DynamicsLift t m where Source #

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

Methods

liftDynamics :: Dynamics m a -> t m a Source #

Lift the specified Dynamics computation into another computation.

Instances

Instances details
Monad m => DynamicsLift Composite m Source # 
Instance details

Defined in Simulation.Aivika.Trans.Composite

Methods

liftDynamics :: Dynamics m a -> Composite m a Source #

MonadDES m => DynamicsLift Cont m Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Cont

Methods

liftDynamics :: Dynamics m a -> Cont m a Source #

MonadDES m => DynamicsLift Process m Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Process

Methods

liftDynamics :: Dynamics m a -> Process m a Source #

Monad m => DynamicsLift Dynamics m Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Dynamics

Methods

liftDynamics :: Dynamics m a -> Dynamics m a Source #

Monad m => DynamicsLift Event m Source # 
Instance details

Defined in Simulation.Aivika.Trans.Internal.Event

Methods

liftDynamics :: Dynamics m a -> Event m a Source #

invokeDynamics :: Point m -> Dynamics m a -> m a Source #

Invoke the Dynamics computation.

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

time :: Monad m => Dynamics m Double Source #

Computation that returns the current simulation time.

isTimeInteg :: Monad m => Dynamics m Bool Source #

Whether the current time is an integration 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 # 
Instance details

Methods

lift :: Monad m => m a -> Dynamics m a #

Monad m => MonadCompTrans Dynamics m Source # 
Instance details

Methods

liftComp :: m a -> Dynamics m a Source #

Monad m => ParameterLift Dynamics m Source # 
Instance details

Methods

liftParameter :: Parameter m a -> Dynamics m a Source #

Monad m => SimulationLift Dynamics m Source # 
Instance details

Monad m => MonadFail (Dynamics m) Source # 
Instance details

Methods

fail :: String -> Dynamics m a #

MonadFix m => MonadFix (Dynamics m) Source # 
Instance details

Methods

mfix :: (a -> Dynamics m a) -> Dynamics m a #

MonadIO m => MonadIO (Dynamics m) Source # 
Instance details

Methods

liftIO :: IO a -> Dynamics m a #

Applicative m => Applicative (Dynamics m) Source # 
Instance details

Methods

pure :: a -> Dynamics m a #

(<*>) :: Dynamics m (a -> b) -> Dynamics m a -> Dynamics m b #

liftA2 :: (a -> b -> c) -> Dynamics m a -> Dynamics m b -> Dynamics m c #

(*>) :: Dynamics m a -> Dynamics m b -> Dynamics m b #

(<*) :: Dynamics m a -> Dynamics m b -> Dynamics m a #

Functor m => Functor (Dynamics m) Source # 
Instance details

Methods

fmap :: (a -> b) -> Dynamics m a -> Dynamics m b #

(<$) :: a -> Dynamics m b -> Dynamics m a #

Monad m => Monad (Dynamics m) Source # 
Instance details

Methods

(>>=) :: Dynamics m a -> (a -> Dynamics m b) -> Dynamics m b #

(>>) :: Dynamics m a -> Dynamics m b -> Dynamics m b #

return :: a -> Dynamics m a #

MonadException m => MonadCatch (Dynamics m) Source # 
Instance details

Methods

catch :: Exception e => Dynamics m a -> (e -> Dynamics m a) -> Dynamics m a #

(MonadException m, MonadMask m) => MonadMask (Dynamics m) Source # 
Instance details

Methods

mask :: ((forall a. Dynamics m a -> Dynamics m a) -> Dynamics m b) -> Dynamics m b #

uninterruptibleMask :: ((forall a. Dynamics m a -> Dynamics m a) -> Dynamics m b) -> Dynamics m b #

generalBracket :: Dynamics m a -> (a -> ExitCase b -> Dynamics m c) -> (a -> Dynamics m b) -> Dynamics m (b, c) #

MonadException m => MonadThrow (Dynamics m) Source # 
Instance details

Methods

throwM :: Exception e => e -> Dynamics m a #

(Floating a, Monad m) => Floating (Dynamics m a) Source # 
Instance details

Methods

pi :: Dynamics m a #

exp :: Dynamics m a -> Dynamics m a #

log :: Dynamics m a -> Dynamics m a #

sqrt :: Dynamics m a -> Dynamics m a #

(**) :: Dynamics m a -> Dynamics m a -> Dynamics m a #

logBase :: Dynamics m a -> Dynamics m a -> Dynamics m a #

sin :: Dynamics m a -> Dynamics m a #

cos :: Dynamics m a -> Dynamics m a #

tan :: Dynamics m a -> Dynamics m a #

asin :: Dynamics m a -> Dynamics m a #

acos :: Dynamics m a -> Dynamics m a #

atan :: Dynamics m a -> Dynamics m a #

sinh :: Dynamics m a -> Dynamics m a #

cosh :: Dynamics m a -> Dynamics m a #

tanh :: Dynamics m a -> Dynamics m a #

asinh :: Dynamics m a -> Dynamics m a #

acosh :: Dynamics m a -> Dynamics m a #

atanh :: Dynamics m a -> Dynamics m a #

log1p :: Dynamics m a -> Dynamics m a #

expm1 :: Dynamics m a -> Dynamics m a #

log1pexp :: Dynamics m a -> Dynamics m a #

log1mexp :: Dynamics m a -> Dynamics m a #

(Num a, Monad m) => Num (Dynamics m a) Source # 
Instance details

Methods

(+) :: Dynamics m a -> Dynamics m a -> Dynamics m a #

(-) :: Dynamics m a -> Dynamics m a -> Dynamics m a #

(*) :: Dynamics m a -> Dynamics m a -> Dynamics m a #

negate :: Dynamics m a -> Dynamics m a #

abs :: Dynamics m a -> Dynamics m a #

signum :: Dynamics m a -> Dynamics m a #

fromInteger :: Integer -> Dynamics m a #

(Fractional a, Monad m) => Fractional (Dynamics m a) Source # 
Instance details

Methods

(/) :: Dynamics m a -> Dynamics m a -> Dynamics m a #

recip :: Dynamics m a -> Dynamics m a #

fromRational :: Rational -> Dynamics m a #