reflex-0.6: Higher-order Functional Reactive Programming

Safe HaskellNone
LanguageHaskell98

Reflex.TriggerEvent.Class

Description

This module defines TriggerEvent, which describes actions that may create new Events that can be triggered from IO.

Synopsis

Documentation

class Monad m => TriggerEvent t m | m -> t where Source #

TriggerEvent represents actions that can create Events that can be triggered by IO actions.

Methods

newTriggerEvent :: m (Event t a, a -> IO ()) Source #

Create a triggerable Event. Whenever the resulting function is called, the resulting Event will fire at some point in the future. Note that this may not be synchronous.

newTriggerEventWithOnComplete :: m (Event t a, a -> IO () -> IO ()) Source #

Like newTriggerEvent, but the callback itself takes another callback, to be invoked once the requested Event occurrence has finished firing. This allows synchronous operation.

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> m (Event t a) Source #

Like newTriggerEventWithOnComplete, but with setup and teardown. This relatively complex type signature allows any external listeners to be subscribed lazily and then removed whenever the returned Event is no longer being listened to. Note that the setup/teardown may happen multiple times, and there is no guarantee that the teardown will be executed promptly, or even at all, in the case of program termination.

Instances
TriggerEvent t m => TriggerEvent t (StateT s m) Source # 
Instance details

Defined in Reflex.TriggerEvent.Class

Methods

newTriggerEvent :: StateT s m (Event t a, a -> IO ()) Source #

newTriggerEventWithOnComplete :: StateT s m (Event t a, a -> IO () -> IO ()) Source #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> StateT s m (Event t a) Source #

TriggerEvent t m => TriggerEvent t (StateT s m) Source # 
Instance details

Defined in Reflex.TriggerEvent.Class

Methods

newTriggerEvent :: StateT s m (Event t a, a -> IO ()) Source #

newTriggerEventWithOnComplete :: StateT s m (Event t a, a -> IO () -> IO ()) Source #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> StateT s m (Event t a) Source #

(Monad m, MonadRef m, Ref m ~ Ref IO, MonadReflexCreateTrigger t m) => TriggerEvent t (TriggerEventT t m) Source # 
Instance details

Defined in Reflex.TriggerEvent.Base

Methods

newTriggerEvent :: TriggerEventT t m (Event t a, a -> IO ()) Source #

newTriggerEventWithOnComplete :: TriggerEventT t m (Event t a, a -> IO () -> IO ()) Source #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> TriggerEventT t m (Event t a) Source #

TriggerEvent t m => TriggerEvent t (PostBuildT t m) Source # 
Instance details

Defined in Reflex.PostBuild.Base

Methods

newTriggerEvent :: PostBuildT t m (Event t a, a -> IO ()) Source #

newTriggerEventWithOnComplete :: PostBuildT t m (Event t a, a -> IO () -> IO ()) Source #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> PostBuildT t m (Event t a) Source #

TriggerEvent t m => TriggerEvent t (ReaderT r m) Source # 
Instance details

Defined in Reflex.TriggerEvent.Class

Methods

newTriggerEvent :: ReaderT r m (Event t a, a -> IO ()) Source #

newTriggerEventWithOnComplete :: ReaderT r m (Event t a, a -> IO () -> IO ()) Source #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> ReaderT r m (Event t a) Source #

TriggerEvent t m => TriggerEvent t (EventWriterT t w m) Source # 
Instance details

Defined in Reflex.EventWriter.Base

Methods

newTriggerEvent :: EventWriterT t w m (Event t a, a -> IO ()) Source #

newTriggerEventWithOnComplete :: EventWriterT t w m (Event t a, a -> IO () -> IO ()) Source #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> EventWriterT t w m (Event t a) Source #

TriggerEvent t m => TriggerEvent t (QueryT t q m) Source # 
Instance details

Defined in Reflex.Query.Base

Methods

newTriggerEvent :: QueryT t q m (Event t a, a -> IO ()) Source #

newTriggerEventWithOnComplete :: QueryT t q m (Event t a, a -> IO () -> IO ()) Source #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> QueryT t q m (Event t a) Source #

TriggerEvent t m => TriggerEvent t (DynamicWriterT t w m) Source # 
Instance details

Defined in Reflex.DynamicWriter.Base

Methods

newTriggerEvent :: DynamicWriterT t w m (Event t a, a -> IO ()) Source #

newTriggerEventWithOnComplete :: DynamicWriterT t w m (Event t a, a -> IO () -> IO ()) Source #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> DynamicWriterT t w m (Event t a) Source #

TriggerEvent t m => TriggerEvent t (BehaviorWriterT t w m) Source # 
Instance details

Defined in Reflex.BehaviorWriter.Base

Methods

newTriggerEvent :: BehaviorWriterT t w m (Event t a, a -> IO ()) Source #

newTriggerEventWithOnComplete :: BehaviorWriterT t w m (Event t a, a -> IO () -> IO ()) Source #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> BehaviorWriterT t w m (Event t a) Source #

TriggerEvent t m => TriggerEvent t (RequesterT t request response m) Source # 
Instance details

Defined in Reflex.Requester.Base

Methods

newTriggerEvent :: RequesterT t request response m (Event t a, a -> IO ()) Source #

newTriggerEventWithOnComplete :: RequesterT t request response m (Event t a, a -> IO () -> IO ()) Source #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> RequesterT t request response m (Event t a) Source #