Safe Haskell | None |
---|---|
Language | Haskell98 |
- listenTrans :: Event a -> (a -> Reactive ()) -> Reactive (IO ())
- schedulePrioritized :: Maybe (MVar Node) -> Reactive () -> Reactive ()
- scheduleLast :: Reactive () -> Reactive ()
- data Listen a = Listen {
- runListen_ :: Maybe (MVar Node) -> Bool -> (a -> Reactive ()) -> Reactive (IO ())
- listenerKeepAlive :: IORef ()
- getListen :: Event a -> Reactive (Listen a)
- linkedListen :: Event a -> Maybe (MVar Node) -> Bool -> (a -> Reactive ()) -> Reactive (IO ())
- data Node
- newEventLinked :: Dep -> IO (Event a, a -> Reactive (), MVar Node)
- newEvent :: Reactive (Event a, a -> Reactive ())
- newEventImpl :: forall p a. IO (Listen a, a -> Reactive (), MVar Node)
- finalizeEvent :: Event a -> IO () -> Event a
- finalizeListen :: Listen a -> IO () -> IO (Listen a)
- ioReactive :: IO a -> Reactive a
- data Unlistener
- addCleanup_Listen :: Unlistener -> Listen a -> Reactive (Listen a)
- data Sample a = Sample {}
- addCleanup_Sample :: Unlistener -> Sample a -> IO (Sample a)
- later :: Reactive (IO ()) -> Reactive Unlistener
- dep :: a -> Dep
- unsafeNewIORef :: a -> b -> IORef a
- data Plain
Documentation
listenTrans :: Event a -> (a -> Reactive ()) -> Reactive (IO ()) Source
Variant of listen
that allows you to initiate more activity in the current
transaction. Useful for implementing new primitives.
schedulePrioritized :: Maybe (MVar Node) -> Reactive () -> Reactive () Source
Queue the specified atomic to run at the end of the priority 2 queue
scheduleLast :: Reactive () -> Reactive () Source
linkedListen :: Event a -> Maybe (MVar Node) -> Bool -> (a -> Reactive ()) -> Reactive (IO ()) Source
Listen for firings of this event. The returned IO ()
is an IO action
that unregisters the listener. This is the observer pattern.
newEventLinked :: Dep -> IO (Event a, a -> Reactive (), MVar Node) Source
Returns an event, and a push action for pushing a value into the event.
newEvent :: Reactive (Event a, a -> Reactive ()) Source
Returns an event, and a push action for pushing a value into the event.
newEventImpl :: forall p a. IO (Listen a, a -> Reactive (), MVar Node) Source
Returns a Listen
for registering listeners, and a push action for pushing
a value into the event.
finalizeEvent :: Event a -> IO () -> Event a Source
Add a finalizer to an event.
ioReactive :: IO a -> Reactive a Source
data Unlistener Source
addCleanup_Listen :: Unlistener -> Listen a -> Reactive (Listen a) Source
Cause the things listened to with later
to be unlistened when the
specified listener is not referenced any more.
addCleanup_Sample :: Unlistener -> Sample a -> IO (Sample a) Source
Cause the things listened to with later
to be unlistened when the
specified sample is not referenced any more.
later :: Reactive (IO ()) -> Reactive Unlistener Source
Perform a listen later so we can tolerate lazy loops.
Returns an Unlistener
that can be attached to an event with addCleanup_Listen
.
unsafeNewIORef :: a -> b -> IORef a Source
Phantom type for use with Context
type class.
Context Plain | |
Monad (Reactive Plain) | |
Functor (Reactive Plain) | |
Functor (Event Plain) | |
Functor (Behavior Plain) | |
MonadFix (Reactive Plain) | |
Applicative (Reactive Plain) | |
Applicative (Behavior Plain) | |
data Reactive Plain = Reactive (StateT ReactiveState IO a) | |
data Event Plain = Event {
| |
data Behavior Plain = Behavior {
|