netwire-5.0.3: Functional reactive programming library

Copyright(c) 2013 Ertugrul Soeylemez
LicenseBSD3
MaintainerErtugrul Soeylemez <es@ertes.de>
Safe HaskellNone
LanguageHaskell2010

Control.Wire.Interval

Contents

Description

 

Synopsis

Basic intervals

inhibit :: e -> Wire s e m a b Source #

Inhibit forever with the given value.

  • Inhibits: always.

Time intervals

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

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 a Source #

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 a Source #

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 a Source #

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) a Source #

Alias for hold.

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

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) a Source #

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) a Source #

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) a Source #

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

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