netwire-5.0.0: Functional reactive programming library

MaintainerErtugrul Soeylemez <es@ertes.de>
Safe HaskellNone

Control.Wire.Interval

Contents

Description

 

Synopsis

Basic intervals

inhibit :: e -> Wire s e m a bSource

Inhibit forever with the given value.

  • Inhibits: always.

Time intervals

after :: (HasTime t s, Monoid e) => t -> Wire s e m a aSource

After the given time period.

  • Depends: now after the given time period.
  • Inhibits: for the given time period.

for :: (HasTime t s, Monoid e) => t -> Wire s e m a aSource

For the given time period.

  • Depends: now for the given time period.
  • Inhibits: after the given time period.

Signal analysis

unless :: Monoid e => (a -> Bool) -> Wire s e m a aSource

When the given predicate is false for the input signal.

  • Depends: now.
  • Inhibits: unless the predicate is false.

when :: Monoid e => (a -> Bool) -> Wire s e m a aSource

When the given predicate is true for the input signal.

  • Depends: now.
  • Inhibits: when the predicate is false.

Event-based intervals

asSoonAs :: Monoid e => Wire s e m (Event a) aSource

Alias for hold.

between :: Monoid e => Wire s e m (a, Event b, Event c) aSource

Start each time the left event occurs, stop each time the right event occurs.

  • Depends: now when active.
  • Inhibits: after the right event occurred, before the left event occurs.

hold :: Monoid e => Wire s e m (Event a) aSource

Start when the event occurs for the first time reflecting its latest value.

  • Depends: now.
  • Inhibits: until the event occurs for the first time.

holdFor :: (HasTime t s, Monoid e) => t -> Wire s e m (Event a) aSource

Hold each event occurrence for the given time period. Inhibits when no event occurred for the given amount of time. New occurrences override old occurrences, even when they are still held.

  • Depends: now.
  • Inhibits: when no event occurred for the given amount of time.

until :: Monoid e => Wire s e m (a, Event b) aSource

Produce until the given event occurs. When it occurs, inhibit with its value forever.

  • Depends: now until event occurs.
  • Inhibits: forever after event occurs.