wires-0.2.0: Functional reactive programming library

Copyright(c) 2017 Ertugrul Söylemez
LicenseBSD3
MaintainerErtugrul Söylemez <esz@posteo.de>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

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.