Maintainer | Ertugrul Soeylemez <es@ertes.de> |
---|
Control.Wire.Prefab.Event
Description
Wires for generating and manipulating events.
- class Arrow >~ => WAfter t (>~) | >~ -> t where
- class Arrow >~ => WAt t (>~) | >~ -> t where
- class Arrow >~ => WDelayEvents t (>~) | >~ -> t where
- delayEvents :: Monoid e => Wire e >~ ([b], t) b
- delayEventsSafe :: Monoid e => Wire e >~ (([b], t), Int) b
- class Arrow >~ => WPeriodically t (>~) | >~ -> t where
- periodically :: Monoid e => Wire e >~ t ()
- inhibit :: WirePure >~ => Wire e >~ e b
- never :: (Monoid e, WirePure >~) => Wire e >~ a b
- asSoonAs :: (Monoid e, WirePure >~) => Wire e >~ Bool ()
- edge :: forall e (>~). (Monoid e, WirePure >~) => Wire e >~ Bool ()
- require :: (Monoid e, WirePure >~) => Wire e >~ Bool ()
- forbid :: (Monoid e, WirePure >~) => Wire e >~ Bool ()
- while :: (Monoid e, WirePure >~) => Wire e >~ Bool ()
- notYet :: (Monoid e, WirePure >~) => Wire e >~ b b
- once :: (Monoid e, WirePure >~) => Wire e >~ b b
Event generation
Timed
class Arrow >~ => WAfter t (>~) | >~ -> t whereSource
Produces once after the input time interval has passed.
- Depends: Current instant.
- Inhibits: Always except at the target instant.
Instances
(AdditiveGroup t, MonadClock t m, Ord t) => WAfter t (Kleisli m) |
class Arrow >~ => WAt t (>~) | >~ -> t whereSource
Produces once as soon as the current global time is later than or equal to the input global time and never again.
- Depends: Current instant.
- Inhibits: Always except at the target instant.
Instances
(MonadClock t m, Ord t) => WAt t (Kleisli m) |
class Arrow >~ => WDelayEvents t (>~) | >~ -> t whereSource
Delay incoming events.
Methods
delayEvents :: Monoid e => Wire e >~ ([b], t) bSource
Delays each incoming event (left signal) by the given time delta (right signal). The time delta at the instant the event happened is significant.
- Depends: Current instant.
- Inhibits: When no delayed event happened.
delayEventsSafe :: Monoid e => Wire e >~ (([b], t), Int) bSource
Delays each incoming event (left signal) by the given time delta (middle signal). The time delta at the instant the event happened is significant. The right signal gives a maximum number of events queued. When exceeded, new events are dropped, until there is enough room.
- Depends: Current instant.
- Inhibits: When no delayed event happened.
Instances
(AdditiveGroup t, MonadClock t m, Ord t) => WDelayEvents t (Kleisli m) |
class Arrow >~ => WPeriodically t (>~) | >~ -> t whereSource
Periodically produces an event. The period is given by the input time delta and can change over time. The current time delta with respect to the last production is significant. Does not produce at the first instant, unless the first delta is nonpositive.
- Depends: Current instant.
- Inhibits: Always except at the periodic ticks.
Methods
periodically :: Monoid e => Wire e >~ t ()Source
Instances
(AdditiveGroup t, MonadClock t m, Ord t) => WPeriodically t (Kleisli m) |
Unconditional inhibition
inhibit :: WirePure >~ => Wire e >~ e bSource
Never produces. Always inhibits with the current input signal.
- Depends: Current instant.
- Inhibits: Always.
never :: (Monoid e, WirePure >~) => Wire e >~ a bSource
Never produces. Equivalent to zeroArrow
.
- Inhibits: Always.