pipes-rt-0.4.1: A few pipes to control the timing of yields

Safe HaskellNone
LanguageHaskell98

Pipes.RealTime

Contents

Synopsis

Pipes throttled by their own timestamps

timeCat :: MonadIO m => (a -> UTCTime) -> Pipe a a m r Source

Yield values at the absolute times given by their timestamps. Assumes that they arrive in ascending time order. Values with timestamps earlier than the starting time of the effect are discarded

timeCatDelayedBy :: MonadIO m => (a -> UTCTime) -> Double -> Pipe a a m r Source

Yield values at their absolute timesteps, but delay or advance their production by some time (given in seconds). Values with timestamps less than zero after adjustment are discarded

relativeTimeCat :: MonadIO m => (a -> Double) -> Pipe a a m r Source

Yield values some time after the effect is run, according to their relative timestamps. Assumes that values arrive in ascending time order. Values with negative relative timestamps are discarded

relativeTimeCatDelayedBy :: MonadIO m => (a -> Double) -> Double -> Pipe a a m r Source

Yield values at their timestamps, but delay by some time (given in seconds). Passing a negative delay advances the generator, discarding events happening before the effect

Pipes throttled by you

steadyCat :: MonadIO m => Double -> Pipe a a m r Source

Yield values at steady rate (Hz)

poissonCat :: MonadIO m => Double -> Pipe a a m r Source

Constant-rate Poisson process yielding values, randomized by IO

poissonCatConst :: MonadIO m => Double -> Pipe a a m r Source

Constant-rate Poisson process with a fixed seed - the same random every time

genPoissonCat :: MonadIO m => GenIO -> Double -> Pipe a a m r Source

Constant-rate Poisson process yielding values, seeded by you

catAtTimes :: MonadIO m => [UTCTime] -> Pipe a a m r Source

Yield values at a set of absolute times. Yield remaining values immediately if the time list becomes empty

catAtRelativeTimes :: MonadIO m => [Double] -> Pipe a a m r Source

Yield values at a set of times relative to the first received value. Yield remaining values immediately if the time list becomes empty