reflex-0.2: Higher-order Functional Reactive Programming

Safe HaskellNone
LanguageHaskell98

Reflex.Host.Class

Documentation

class Reflex t => ReflexHost t Source

Associated Types

type EventTrigger t :: * -> * Source

type EventHandle t :: * -> * Source

type HostFrame t :: * -> * Source

Instances

class (ReflexHost t, Monad m) => MonadReadEvent t m | m -> t where Source

Methods

readEvent :: EventHandle t a -> m (Maybe (m a)) Source

class (Monad m, ReflexHost t) => MonadReflexCreateTrigger t m | m -> t where Source

Methods

newEventWithTrigger :: (EventTrigger t a -> IO (IO ())) -> m (Event t a) Source

Creates an original Event (one that is not based on any other event). When a subscriber first subscribes to an event (building another event that depends on the subscription) the given callback function is run by passing a trigger. The event is then set up in IO. The callback function returns an accompanying teardown action. Any time between setup and teardown the trigger can be used to fire the event.

class (Monad m, ReflexHost t, MonadReflexCreateTrigger t m) => MonadReflexHost t m | m -> t where Source

Methods

fireEventsAndRead :: [DSum (EventTrigger t)] -> (forall m'. MonadReadEvent t m' => m' a) -> m a Source

subscribeEvent :: Event t a -> m (EventHandle t a) Source

runFrame :: PushM t a -> m a Source

runHostFrame :: HostFrame t a -> m a Source