aivika-6.1.1: A multi-method 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.Internal.Dynamics

Description

Tested with: GHC 8.0.1

This is an internal implementation module that should never be used directly.

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

Synopsis

Dynamics

newtype Dynamics a Source #

A value in the Dynamics monad represents a polymorphic time varying function.

Constructors

Dynamics (Point -> IO a) 

Instances

Instances details
DynamicsLift Dynamics Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

ParameterLift Dynamics Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

SimulationLift Dynamics Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

ResultComputing Dynamics Source # 
Instance details

Defined in Simulation.Aivika.Results

MonadFail Dynamics Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

Methods

fail :: String -> Dynamics a #

MonadFix Dynamics Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

Methods

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

MonadIO Dynamics Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

Methods

liftIO :: IO a -> Dynamics a #

Applicative Dynamics Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

Methods

pure :: a -> Dynamics a #

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

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

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

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

Functor Dynamics Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

Methods

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

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

Monad Dynamics Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

Methods

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

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

return :: a -> Dynamics a #

MonadCatch Dynamics Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

Methods

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

MonadMask Dynamics Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

Methods

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

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

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

MonadThrow Dynamics Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

Methods

throwM :: (HasCallStack, Exception e) => e -> Dynamics a #

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

Defined in Simulation.Aivika.Results

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

Defined in Simulation.Aivika.Results

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

Defined in Simulation.Aivika.Results

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

Defined in Simulation.Aivika.Results

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

Defined in Simulation.Aivika.Results

Floating a => Floating (Dynamics a) Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

Num a => Num (Dynamics a) Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

Fractional a => Fractional (Dynamics a) Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

Show (Dynamics a) Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

Methods

showsPrec :: Int -> Dynamics a -> ShowS #

show :: Dynamics a -> String #

showList :: [Dynamics a] -> ShowS #

Eq (Dynamics a) Source # 
Instance details

Defined in Simulation.Aivika.Internal.Dynamics

Methods

(==) :: Dynamics a -> Dynamics a -> Bool #

(/=) :: Dynamics a -> Dynamics a -> Bool #

class DynamicsLift m where Source #

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

Methods

liftDynamics :: Dynamics a -> m a Source #

Lift the specified Dynamics computation to another computation.

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

Invoke the Dynamics computation.

runDynamicsInStartTime :: Dynamics a -> Simulation a Source #

Run the Dynamics computation in the initial time point.

runDynamicsInStopTime :: Dynamics a -> Simulation a Source #

Run the Dynamics computation in the final time point.

runDynamicsInIntegTimes :: Dynamics a -> Simulation [IO a] Source #

Run the Dynamics computation in all integration time points.

runDynamicsInTime :: Double -> Dynamics a -> Simulation a Source #

Run the Dynamics computation in the specified time point.

runDynamicsInTimes :: [Double] -> Dynamics a -> Simulation [IO a] Source #

Run the Dynamics computation in the specified time points.

Error Handling

catchDynamics :: Exception e => Dynamics a -> (e -> Dynamics a) -> Dynamics a Source #

Exception handling within Dynamics computations.

finallyDynamics :: Dynamics a -> Dynamics b -> Dynamics a Source #

A computation with finalization part like the finally function.

throwDynamics :: Exception e => e -> Dynamics a Source #

Like the standard throw function.

Simulation Time

time :: Dynamics Double Source #

Computation that returns the current simulation time.

isTimeInteg :: Dynamics Bool Source #

Whether the current time is an integration time.

integIteration :: Dynamics Int Source #

Return the integration iteration closest to the current simulation time.

integPhase :: Dynamics Int Source #

Return the integration phase for the current simulation time. It is (-1) for non-integration time points.

Debugging

traceDynamics :: String -> Dynamics a -> Dynamics a Source #

Show the debug message with the current simulation time.