wires-0.2.1: Functional reactive programming library

Control.Wire.Utils

Contents

Description

Synopsis

# Wire utilities

withM_ :: Monad m => (s -> Wire m a b) -> m s -> Wire m a b Source #

Run the given action to initialise the given wire. Simplified variant of withM. Example:

withM_ (scan f) action

# Event utilities

filterE :: (a -> Bool) -> Event a -> Event a Source #

Filter event occurrences using the given function.

scan :: Monad m => a -> Wire m (Event (a -> a)) a Source #

Left scan and hold of the given event.

scan' :: Monad m => a -> Wire m (Event (a -> a)) a Source #

Left scan and hold of the given event. The value switch occurs instantly.

scanE :: Applicative m => a -> Wire m (Event (a -> a)) (Event a) Source #

Left scan of the given event.

splitE :: Event (Either a b) -> (Event a, Event b) Source #

Split the given event

unalignE :: Event (These a b) -> (Event a, Event b) Source #

Split the given event

Inverse of align.

unlessE :: Event a -> Event b -> Event a Source #

Event difference: like the left event, but only when the right event doesn't occur at the same time.