Copyright | Copyright (c) 2009-2016 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
It defines the Composite
monad transformer that allows constructing components which
can be then destroyed in case of need.
- data Composite m a
- runComposite :: Composite m a -> DisposableEvent m -> Event m (a, DisposableEvent m)
- runComposite_ :: Monad m => Composite m a -> Event m a
- runCompositeInStartTime_ :: MonadDES m => Composite m a -> Simulation m a
- runCompositeInStopTime_ :: MonadDES m => Composite m a -> Simulation m a
- disposableComposite :: Monad m => DisposableEvent m -> Composite m ()
Composite Monad
It represents a composite which can be then destroyed in case of need.
MonadTrans Composite Source # | |
Monad m => MonadCompTrans Composite m Source # | |
Monad m => ParameterLift Composite m Source # | |
Monad m => SimulationLift Composite m Source # | |
Monad m => DynamicsLift Composite m Source # | |
Monad m => EventLift Composite m Source # | |
Monad m => Monad (Composite m) Source # | |
Monad m => Functor (Composite m) Source # | |
(Monad m, MonadFix (Event m)) => MonadFix (Composite m) Source # | |
Monad m => Applicative (Composite m) Source # | |
(Monad m, MonadIO (Event m)) => MonadIO (Composite m) Source # | |
runComposite :: Composite m a -> DisposableEvent m -> Event m (a, DisposableEvent m) 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_ :: Monad m => Composite m a -> Event m a Source #
Like runComposite
but retains the composite parts during the simulation.
runCompositeInStartTime_ :: MonadDES m => Composite m a -> Simulation m a Source #
Like runComposite_
but runs the computation in the start time.
runCompositeInStopTime_ :: MonadDES m => Composite m a -> Simulation m a Source #
Like runComposite_
but runs the computation in the stop time.
disposableComposite :: Monad m => DisposableEvent m -> Composite m () Source #
When destroying the composite, the specified action will be applied.