Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- data TickInfo = TickInfo {}
- tickLossy :: (PostBuild t m, PerformEvent t m, TriggerEvent t m, MonadIO (Performable m), MonadFix m) => NominalDiffTime -> UTCTime -> m (Event t TickInfo)
- tickLossyFromPostBuildTime :: (PostBuild t m, PerformEvent t m, TriggerEvent t m, MonadIO (Performable m), MonadFix m) => NominalDiffTime -> m (Event t TickInfo)
- tickLossyFrom :: (PerformEvent t m, TriggerEvent t m, MonadIO (Performable m), MonadFix m) => NominalDiffTime -> UTCTime -> Event t a -> m (Event t TickInfo)
- tickLossyFrom' :: (PerformEvent t m, TriggerEvent t m, MonadIO (Performable m), MonadFix m) => Event t (NominalDiffTime, UTCTime) -> m (Event t TickInfo)
- clockLossy :: (MonadIO m, PerformEvent t m, TriggerEvent t m, MonadIO (Performable m), PostBuild t m, MonadHold t m, MonadFix m) => NominalDiffTime -> UTCTime -> m (Dynamic t TickInfo)
- getCurrentTick :: NominalDiffTime -> UTCTime -> IO TickInfo
- delay :: (PerformEvent t m, TriggerEvent t m, MonadIO (Performable m)) => NominalDiffTime -> Event t a -> m (Event t a)
- poissonLossyFrom :: (RandomGen g, MonadIO (Performable m), PerformEvent t m, TriggerEvent t m) => g -> Double -> UTCTime -> Event t a -> m (Event t TickInfo)
- poissonLossy :: (RandomGen g, MonadIO (Performable m), PerformEvent t m, TriggerEvent t m, PostBuild t m) => g -> Double -> UTCTime -> m (Event t TickInfo)
- inhomogeneousPoissonFrom :: (RandomGen g, MonadIO (Performable m), PerformEvent t m, TriggerEvent t m) => g -> Behavior t Double -> Double -> UTCTime -> Event t a -> m (Event t TickInfo)
- inhomogeneousPoisson :: (RandomGen g, MonadIO (Performable m), PerformEvent t m, TriggerEvent t m, PostBuild t m) => g -> Behavior t Double -> Double -> UTCTime -> m (Event t TickInfo)
- debounce :: (MonadFix m, MonadHold t m, PerformEvent t m, TriggerEvent t m, MonadIO (Performable m)) => NominalDiffTime -> Event t a -> m (Event t a)
- batchOccurrences :: (MonadFix m, MonadHold t m, PerformEvent t m, TriggerEvent t m, MonadIO (Performable m)) => NominalDiffTime -> Event t a -> m (Event t (Seq a))
- throttle :: (MonadFix m, MonadHold t m, PerformEvent t m, TriggerEvent t m, MonadIO (Performable m)) => NominalDiffTime -> Event t a -> m (Event t a)
- tickInfo_n :: Lens' TickInfo Integer
- tickInfo_lastUTC :: Lens' TickInfo UTCTime
- tickInfo_alreadyElapsed :: Lens' TickInfo NominalDiffTime
Documentation
TickInfo | |
|
tickLossy :: (PostBuild t m, PerformEvent t m, TriggerEvent t m, MonadIO (Performable m), MonadFix m) => NominalDiffTime -> UTCTime -> m (Event t TickInfo) Source #
Special case of tickLossyFrom
that uses the post-build event to start the
tick thread.
tickLossyFromPostBuildTime :: (PostBuild t m, PerformEvent t m, TriggerEvent t m, MonadIO (Performable m), MonadFix m) => NominalDiffTime -> m (Event t TickInfo) Source #
Special case of tickLossyFrom
that uses the post-build event to start the
tick thread and the time of the post-build as the tick basis time.
:: (PerformEvent t m, TriggerEvent t m, MonadIO (Performable m), MonadFix m) | |
=> NominalDiffTime | The length of a tick interval |
-> UTCTime | The basis time from which intervals count |
-> Event t a | Event that starts a tick generation thread. Usually you want this to be something like the result of getPostBuild that only fires once. But there could be uses for starting multiple timer threads. |
-> m (Event t TickInfo) |
Send events over time with the given basis time and interval If the system starts running behind, occurrences will be dropped rather than buffered Each occurrence of the resulting event will contain the index of the current interval, with 0 representing the basis time
:: (PerformEvent t m, TriggerEvent t m, MonadIO (Performable m), MonadFix m) | |
=> Event t (NominalDiffTime, UTCTime) | Event that starts a tick generation thread. Usually you want this to be something like the result of getPostBuild that only fires once. But there could be uses for starting multiple timer threads. |
-> m (Event t TickInfo) |
Generalization of tickLossyFrom that takes dt and t0 in the event.
clockLossy :: (MonadIO m, PerformEvent t m, TriggerEvent t m, MonadIO (Performable m), PostBuild t m, MonadHold t m, MonadFix m) => NominalDiffTime -> UTCTime -> m (Dynamic t TickInfo) Source #
getCurrentTick :: NominalDiffTime -> UTCTime -> IO TickInfo Source #
delay :: (PerformEvent t m, TriggerEvent t m, MonadIO (Performable m)) => NominalDiffTime -> Event t a -> m (Event t a) Source #
Delay an Event's occurrences by a given amount in seconds.
:: (RandomGen g, MonadIO (Performable m), PerformEvent t m, TriggerEvent t m) | |
=> g | |
-> Double | Poisson event rate (Hz) |
-> UTCTime | Baseline time for events |
-> Event t a | Event that starts a tick generation thread. Usually you want this to be something like the result of getPostBuild that only fires once. But there could be uses for starting multiple timer threads. Start sending events in response to the event parameter. |
-> m (Event t TickInfo) |
Send events with Poisson timing with the given basis and rate Each occurrence of the resulting event will contain the index of the current interval, with 0 representing the basis time
:: (RandomGen g, MonadIO (Performable m), PerformEvent t m, TriggerEvent t m, PostBuild t m) | |
=> g | |
-> Double | Poisson event rate (Hz) |
-> UTCTime | Baseline time for events |
-> m (Event t TickInfo) |
Send events with Poisson timing with the given basis and rate Each occurrence of the resulting event will contain the index of the current interval, with 0 representing the basis time. Automatically begin sending events when the DOM is built
inhomogeneousPoissonFrom :: (RandomGen g, MonadIO (Performable m), PerformEvent t m, TriggerEvent t m) => g -> Behavior t Double -> Double -> UTCTime -> Event t a -> m (Event t TickInfo) Source #
Send events with inhomogeneous Poisson timing with the given basis and variable rate. Provide a maxRate that you expect to support.
inhomogeneousPoisson :: (RandomGen g, MonadIO (Performable m), PerformEvent t m, TriggerEvent t m, PostBuild t m) => g -> Behavior t Double -> Double -> UTCTime -> m (Event t TickInfo) Source #
Send events with inhomogeneous Poisson timing with the given basis and variable rate. Provide a maxRate that you expect to support
debounce :: (MonadFix m, MonadHold t m, PerformEvent t m, TriggerEvent t m, MonadIO (Performable m)) => NominalDiffTime -> Event t a -> m (Event t a) Source #
Block occurrences of an Event until the given number of seconds elapses without the Event firing, at which point the last occurrence of the Event will fire.
batchOccurrences :: (MonadFix m, MonadHold t m, PerformEvent t m, TriggerEvent t m, MonadIO (Performable m)) => NominalDiffTime -> Event t a -> m (Event t (Seq a)) Source #
throttle :: (MonadFix m, MonadHold t m, PerformEvent t m, TriggerEvent t m, MonadIO (Performable m)) => NominalDiffTime -> Event t a -> m (Event t a) Source #
Throttle an input event, ensuring that at least a given amount of time passes between occurrences of the output event. If the input event occurs too frequently, the output event occurs with the most recently seen input value after the given delay passes since the last occurrence of the output. If the output event has not occurred recently, occurrences of the input event will cause the output event to fire immediately.