reactivity-0.3.2.4: An alternate implementation of push-pull FRP.

Safe HaskellTrustworthy
LanguageHaskell98

FRP.Reactivity.Measurement

Description

The elements of FRP.

Synopsis

Documentation

data Measurement t Source #

Measurements are a basic building block for pull-based FRP. They are like futures in that: when you have something running on a separate thread, you can use a Measurement to wait on it. They also establish a measurement of an an event occurrence time. Primitives for Measurements, make this measurement inside an STM (software transactional memory) block. The STM system induces a global time ordering of transactions. I piggyback on top of this mechanism to get a global time ordering of measurement as well. This is an attempt to answer the tricky question of how to measure.

Constructors

Empty 

await :: POSIXTime -> IO (Measurement ()) Source #

Wait for a time, then measure that time.

blindAwait :: POSIXTime -> Measurement () Source #

Give the parameter time as the time of the measurement. This is "blind" to system lags that may disrupt the timing of a control signal.

assertChan :: forall t. IO (t -> POSIXTime -> IO (), [Measurement t]) Source #

chan :: IO (t -> IO (), [Measurement t]) Source #

first :: Measurement t -> Measurement t -> Measurement t Source #

Decide which of the Measurements comes first. I rely on the STM subsystem to find a consistent ordering.

getValue :: Measurement t -> IO (t, POSIXTime) Source #

Extract value and time of the measurement.