Safe Haskell | Trustworthy |
---|---|
Language | Haskell98 |
The elements of FRP.
- data Measurement t = Empty
- wait :: Measurement t -> IO ()
- stmAction :: Measurement t -> STM (Maybe (t, POSIXTime))
- assertMeasurement :: IO (t, POSIXTime) -> IO (Measurement t)
- measure :: IO t -> IO (Measurement t)
- await :: POSIXTime -> IO (Measurement ())
- blindAwait :: POSIXTime -> Measurement ()
- fromList :: [(t, POSIXTime)] -> [Measurement t]
- assertChan :: forall t. IO (t -> POSIXTime -> IO (), [Measurement t])
- chan :: IO (t -> IO (), [Measurement t])
- first :: Measurement t -> Measurement t -> Measurement t
- leMeas :: Measurement t -> Measurement u -> Bool
- mergeStreams :: [Measurement a] -> [Measurement a] -> [Measurement a]
- getValue :: Measurement t -> IO (t, POSIXTime)
- copoint :: Measurement t -> t
- time :: Measurement t -> POSIXTime
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.
Monad Measurement Source # | |
Functor Measurement Source # | |
Applicative Measurement Source # | |
Alternative Measurement Source # | |
MonadPlus Measurement Source # | |
Eq t => Eq (Measurement t) Source # | |
Show t => Show (Measurement t) Source # | |
Monoid (Measurement t) Source # | |
wait :: Measurement t -> IO () Source #
assertMeasurement :: IO (t, POSIXTime) -> IO (Measurement t) Source #
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.
fromList :: [(t, POSIXTime)] -> [Measurement t] Source #
assertChan :: forall t. IO (t -> POSIXTime -> IO (), [Measurement t]) Source #
first :: Measurement t -> Measurement t -> Measurement t Source #
Decide which of the Measurement
s comes first. I rely on the STM
subsystem to find
a consistent ordering.
leMeas :: Measurement t -> Measurement u -> Bool Source #
mergeStreams :: [Measurement a] -> [Measurement a] -> [Measurement a] Source #
copoint :: Measurement t -> t Source #
time :: Measurement t -> POSIXTime Source #