Safe Haskell | None |
---|---|
Language | Haskell2010 |
Programing with single shot events, i.e. events that may occur at most once.
Synopsis
- map :: Box (a -> b) -> Event a -> Event b
- never :: Event a
- switch :: Str a -> Event (Str a) -> Str a
- switchTrans :: (Str a -> Str b) -> Event (Str a -> Str b) -> Str a -> Str b
- whenJust :: Str (Maybe' a) -> Str (Event a)
- data Event a
- await :: (Stable a, Stable b) => Event a -> Event b -> Event (a :* b)
- trigger :: Box (a -> Bool) -> Str a -> Event a
- triggerMap :: Box (a -> Maybe' b) -> Str a -> Event b
Documentation
map :: Box (a -> b) -> Event a -> Event b Source #
Apply a function to the value of the event (if it ever occurs).
switch :: Str a -> Event (Str a) -> Str a Source #
switch s e
will behave like s
until the event e
occurs with
value s'
, in which case it will behave as s'
.
switchTrans :: (Str a -> Str b) -> Event (Str a -> Str b) -> Str a -> Str b Source #
Like switch
but works on stream functions instead of
streams. That is, switchTrans s e
will behave like s
until the
event e
occurs with value s'
, in which case it will behave as
s'
.
whenJust :: Str (Maybe' a) -> Str (Event a) Source #
Turn a stream of Maybe'
s into a stream of events. Each such
event behaves as if created by firstJust
.
await :: (Stable a, Stable b) => Event a -> Event b -> Event (a :* b) Source #
Synchronize two events. The resulting event occurs after both events have occurred (coinciding with whichever event occurred last.