Safe Haskell | None |
---|---|
Language | Haskell98 |
- newtype Event a = Event {}
- newtype Behavior a = Behavior {
- getBehavior' :: Updater a
- newtype Updater a = Updater {}
- newEvent' :: IO (Updater a, a -> IO ())
- cacheStateless' :: Updater a -> Updater (Updater a)
- cacheStateful' :: Updater a -> Updater (Updater a)
- runUpdater :: Updater (Either (IO ()) res) -> IO res
- unsafeLiftIO :: IO a -> Behavior a
- debug :: String -> Behavior ()
- debugCleanup :: String -> Behavior ()
- onCommit :: IO () -> Behavior ()
- justOne :: Updater a -> Updater a
- data UpState = UpState {
- stateOnCleanup :: IO ()
- stateOnCommit :: IO ()
- data DownState = DownState {
Documentation
Push based Updater.
Pull based Updater
Behavior | |
|
This monad works very similar to a continuation monad on top of stm.
You can do any basic stm computation you want simply using liftSTM
.
However, if you use getEvent
everything after that call will be executed
everytime the Signal
given to getEvent
is changed.
You can also use the Alternative
instance to make a union of events.
You can also use the Applicative
instance to run two things 'parallel'.
Parallel meaning that events on one side will not cause the other
side to be reevaluated completely.
cacheStateless' :: Updater a -> Updater (Updater a) Source
cacheStateful' :: Updater a -> Updater (Updater a) Source
unsafeLiftIO :: IO a -> Behavior a Source
Don't execute the io-action returned by newEvent
.
Also, fork; don't block.
debugCleanup :: String -> Behavior () Source
This can be useful to spot when listeners are removed.