Copyright | Copyright (c) 2009-2017 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 8.0.1
It defines the Composite
monad that allows constructing components which
can be then destroyed in case of need.
Synopsis
- data Composite a
- class CompositeLift m where
- liftComposite :: Composite a -> m a
- runComposite :: Composite a -> DisposableEvent -> Event (a, DisposableEvent)
- runComposite_ :: Composite a -> Event a
- runCompositeInStartTime_ :: Composite a -> Simulation a
- runCompositeInStopTime_ :: Composite a -> Simulation a
- disposableComposite :: DisposableEvent -> Composite ()
Composite Monad
It represents a composite which can be then destroyed in case of need.
Instances
CompositeLift Composite Source # | |
Defined in Simulation.Aivika.Composite liftComposite :: Composite a -> Composite a Source # | |
DynamicsLift Composite Source # | |
Defined in Simulation.Aivika.Composite liftDynamics :: Dynamics a -> Composite a Source # | |
EventLift Composite Source # | |
ParameterLift Composite Source # | |
Defined in Simulation.Aivika.Composite liftParameter :: Parameter a -> Composite a Source # | |
SimulationLift Composite Source # | |
Defined in Simulation.Aivika.Composite liftSimulation :: Simulation a -> Composite a Source # | |
MonadFail Composite Source # | |
Defined in Simulation.Aivika.Composite | |
MonadFix Composite Source # | |
Defined in Simulation.Aivika.Composite | |
MonadIO Composite Source # | |
Defined in Simulation.Aivika.Composite | |
Applicative Composite Source # | |
Functor Composite Source # | |
Monad Composite Source # | |
class CompositeLift m where Source #
A type class to lift the Composite
computation to other computations.
liftComposite :: Composite a -> m a Source #
Lift the specified Composite
computation to another computation.
Instances
CompositeLift Composite Source # | |
Defined in Simulation.Aivika.Composite liftComposite :: Composite a -> Composite a Source # |
runComposite :: Composite a -> DisposableEvent -> Event (a, DisposableEvent) Source #
Run the computation returning the result
and some DisposableEvent
that being applied
destroys the composite, for example, unsubscribes
from signals or cancels the processes.
runComposite_ :: Composite a -> Event a Source #
Like runComposite
but retains the composite parts during the simulation.
runCompositeInStartTime_ :: Composite a -> Simulation a Source #
Like runComposite_
but runs the computation in the start time.
runCompositeInStopTime_ :: Composite a -> Simulation a Source #
Like runComposite_
but runs the computation in the stop time.
disposableComposite :: DisposableEvent -> Composite () Source #
When destroying the composite, the specified action will be applied.