aivika-transformers-6.1.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.Channel

Description

Tested with: GHC 8.0.1

The module defines a channel that transforms one Signal to another within the Composite computation.

Synopsis

Channel Computation

newtype Channel m a b Source #

It allows representing a signal transformation.

Constructors

Channel 

Fields

Instances

Instances details
MonadDES m => Category (Channel m :: Type -> Type -> Type) Source # 
Instance details

Defined in Simulation.Aivika.Trans.Channel

Methods

id :: forall (a :: k). Channel m a a #

(.) :: forall (b :: k) (c :: k) (a :: k). Channel m b c -> Channel m a b -> Channel m a c #

Delay Channel

delayChannel Source #

Arguments

:: MonadDES m 
=> Double

the delay

-> Channel m a a

the delay channel

Return a delayed signal.

This is actually the delaySignal function wrapped in the Channel type.

delayChannelM Source #

Arguments

:: MonadDES m 
=> Event m Double

the delay

-> Channel m a a

the delay channel

Like delayChannel, but it re-computes the delay each time.

This is actually the delaySignalM function wrapped in the Channel type.

Sinking Signal

sinkSignal :: MonadDES m => Signal m a -> Composite m () Source #

Sink the signal. It returns a computation that subscribes to the signal and then ignores the received data. The resulting computation can be a moving force to simulate the whole system of the interconnected signals and channels.

Debugging

traceChannel :: MonadDES m => String -> Channel m a b -> Channel m a b Source #

Show the debug message with the current simulation time, when emitting the output signal.