Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module defines TriggerEventT
, the standard implementation of
TriggerEvent
.
Synopsis
- newtype TriggerEventT t m a = TriggerEventT {
- unTriggerEventT :: ReaderT (Chan [DSum (EventTriggerRef t) TriggerInvocation]) m a
- runTriggerEventT :: TriggerEventT t m a -> Chan [DSum (EventTriggerRef t) TriggerInvocation] -> m a
- askEvents :: Monad m => TriggerEventT t m (Chan [DSum (EventTriggerRef t) TriggerInvocation])
- data TriggerInvocation a = TriggerInvocation a (IO ())
- newtype EventTriggerRef t a = EventTriggerRef {
- unEventTriggerRef :: IORef (Maybe (EventTrigger t a))
Documentation
newtype TriggerEventT t m a Source #
A basic implementation of TriggerEvent
.
TriggerEventT | |
|
Instances
runTriggerEventT :: TriggerEventT t m a -> Chan [DSum (EventTriggerRef t) TriggerInvocation] -> m a Source #
Run a TriggerEventT
action. The argument should be a Chan
into which
TriggerInvocation
s can be passed; it is expected that some other thread
will be responsible for popping values out of the Chan
and firing their
EventTrigger
s.
askEvents :: Monad m => TriggerEventT t m (Chan [DSum (EventTriggerRef t) TriggerInvocation]) Source #
Retrieve the current Chan
; event trigger invocations pushed into it will
be fired.
data TriggerInvocation a Source #
A value with which to fire an Event
, as well as a callback to invoke
after its propagation has completed.
TriggerInvocation a (IO ()) |
newtype EventTriggerRef t a Source #
A reference to an EventTrigger
suitable for firing with TriggerEventT
.
EventTriggerRef | |
|