aivika-transformers-5.7: Transformers for the Aivika simulation library

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 FieldsrunChannel :: Signal m a -> Composite m (Signal m b)Run the channel transform.

Instances

 MonadDES m => Category * (Channel m) Source # Methodsid :: cat a a #(.) :: cat b c -> cat a b -> cat a c #

# Delay Channel

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.

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.