| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Rattus.Events
Description
Programming with many-shot events, i.e. events that may occur zero or more times.
Synopsis
- map :: Box (a -> b) -> Events a -> Events b
- never :: Events a
- switch :: Str a -> Events (Str a) -> Str a
- switchTrans :: (Str a -> Str b) -> Events (Str a -> Str b) -> Str a -> Str b
- type Events a = Str (Maybe' a)
- trigger :: Box (a -> Bool) -> Str a -> Events a
- triggerMap :: Box (a -> Maybe' b) -> Str a -> Events b
Documentation
map :: Box (a -> b) -> Events a -> Events b Source #
Apply a function to the values of the event (every time it occurs).
switch :: Str a -> Events (Str a) -> Str a Source #
switch s e will behave like s but switches to s'$ every time
the event s'@.e occurs with some value
switchTrans :: (Str a -> Str b) -> Events (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 but
switches to s'$ every time the event s'@.e occurs with some value