reflex-0.8.2.2: Higher-order Functional Reactive Programming

Safe HaskellNone
LanguageHaskell2010

Reflex.PerformEvent.Base

Description

This module provides PerformEventT, the standard implementation of PerformEvent.

Synopsis

Documentation

newtype PerformEventT t m a Source #

Provides a basic implementation of PerformEvent. Note that, despite the name, PerformEventT is not an instance of MonadTrans.

Instances
(ReflexHost t, PrimMonad (HostFrame t)) => Adjustable t (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Methods

runWithReplace :: PerformEventT t m a -> Event t (PerformEventT t m b) -> PerformEventT t m (a, Event t b) Source #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> PerformEventT t m v') -> IntMap v -> Event t (PatchIntMap v) -> PerformEventT t m (IntMap v', Event t (PatchIntMap v')) Source #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> PerformEventT t m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> PerformEventT t m (DMap k v', Event t (PatchDMap k v')) Source #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> PerformEventT t m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> PerformEventT t m (DMap k v', Event t (PatchDMapWithMove k v')) Source #

ReflexHost t => MonadReflexCreateTrigger t (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Methods

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

newFanEventWithTrigger :: GCompare k => (forall a. k a -> EventTrigger t a -> IO (IO ())) -> PerformEventT t m (EventSelector t k) Source #

(ReflexHost t, Ref m ~ Ref IO) => PerformEvent t (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Associated Types

type Performable (PerformEventT t m) :: Type -> Type Source #

(ReflexHost t, NotReady t (HostFrame t)) => NotReady t (PerformEventT t m) Source # 
Instance details

Defined in Reflex.NotReady.Class

(ReflexHost t, MonadHold t m) => MonadHold (t :: Type) (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Methods

hold :: a -> Event t a -> PerformEventT t m (Behavior t a) Source #

holdDyn :: a -> Event t a -> PerformEventT t m (Dynamic t a) Source #

holdIncremental :: Patch p => PatchTarget p -> Event t p -> PerformEventT t m (Incremental t p) Source #

buildDynamic :: PushM t a -> Event t a -> PerformEventT t m (Dynamic t a) Source #

headE :: Event t a -> PerformEventT t m (Event t a) Source #

now :: PerformEventT t m (Event t ()) Source #

ReflexHost t => MonadSample (t :: Type) (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Methods

sample :: Behavior t a -> PerformEventT t m a Source #

HasSpiderTimeline x => NotReady (SpiderTimeline x) (PerformEventT (SpiderTimeline x) (SpiderHost x)) Source # 
Instance details

Defined in Reflex.Spider.Internal

ReflexHost t => Monad (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Methods

(>>=) :: PerformEventT t m a -> (a -> PerformEventT t m b) -> PerformEventT t m b #

(>>) :: PerformEventT t m a -> PerformEventT t m b -> PerformEventT t m b #

return :: a -> PerformEventT t m a #

fail :: String -> PerformEventT t m a #

ReflexHost t => Functor (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Methods

fmap :: (a -> b) -> PerformEventT t m a -> PerformEventT t m b #

(<$) :: a -> PerformEventT t m b -> PerformEventT t m a #

ReflexHost t => MonadFix (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Methods

mfix :: (a -> PerformEventT t m a) -> PerformEventT t m a #

ReflexHost t => Applicative (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Methods

pure :: a -> PerformEventT t m a #

(<*>) :: PerformEventT t m (a -> b) -> PerformEventT t m a -> PerformEventT t m b #

liftA2 :: (a -> b -> c) -> PerformEventT t m a -> PerformEventT t m b -> PerformEventT t m c #

(*>) :: PerformEventT t m a -> PerformEventT t m b -> PerformEventT t m b #

(<*) :: PerformEventT t m a -> PerformEventT t m b -> PerformEventT t m a #

(ReflexHost t, MonadIO (HostFrame t)) => MonadIO (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Methods

liftIO :: IO a -> PerformEventT t m a #

(ReflexHost t, MonadException (HostFrame t)) => MonadException (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Methods

throw :: Exception e => e -> PerformEventT t m a #

catch :: Exception e => PerformEventT t m a -> (e -> PerformEventT t m a) -> PerformEventT t m a #

finally :: PerformEventT t m a -> PerformEventT t m b -> PerformEventT t m a #

(PrimMonad (HostFrame t), ReflexHost t) => PrimMonad (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Associated Types

type PrimState (PerformEventT t m) :: Type #

Methods

primitive :: (State# (PrimState (PerformEventT t m)) -> (#State# (PrimState (PerformEventT t m)), a#)) -> PerformEventT t m a #

(MonadRef (HostFrame t), ReflexHost t) => MonadRef (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Associated Types

type Ref (PerformEventT t m) :: Type -> Type #

Methods

newRef :: a -> PerformEventT t m (Ref (PerformEventT t m) a) #

readRef :: Ref (PerformEventT t m) a -> PerformEventT t m a #

writeRef :: Ref (PerformEventT t m) a -> a -> PerformEventT t m () #

modifyRef :: Ref (PerformEventT t m) a -> (a -> a) -> PerformEventT t m () #

modifyRef' :: Ref (PerformEventT t m) a -> (a -> a) -> PerformEventT t m () #

(MonadAtomicRef (HostFrame t), ReflexHost t) => MonadAtomicRef (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Methods

atomicModifyRef :: Ref (PerformEventT t m) a -> (a -> (a, b)) -> PerformEventT t m b #

atomicModifyRef' :: Ref (PerformEventT t m) a -> (a -> (a, b)) -> PerformEventT t m b #

(ReflexHost t, Semigroup a) => Semigroup (PerformEventT t m a) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Methods

(<>) :: PerformEventT t m a -> PerformEventT t m a -> PerformEventT t m a #

sconcat :: NonEmpty (PerformEventT t m a) -> PerformEventT t m a #

stimes :: Integral b => b -> PerformEventT t m a -> PerformEventT t m a #

(ReflexHost t, Monoid a) => Monoid (PerformEventT t m a) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

Methods

mempty :: PerformEventT t m a #

mappend :: PerformEventT t m a -> PerformEventT t m a -> PerformEventT t m a #

mconcat :: [PerformEventT t m a] -> PerformEventT t m a #

type PrimState (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

type Ref (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

type Ref (PerformEventT t m) = Ref (HostFrame t)
type Performable (PerformEventT t m) Source # 
Instance details

Defined in Reflex.PerformEvent.Base

newtype FireCommand t m Source #

A function that fires events for the given EventTriggers and then runs any followup actions provided via PerformEvent. The given ReadPhase action will be run once for the initial trigger execution as well as once for each followup.

Constructors

FireCommand 

Fields

hostPerformEventT :: forall t m a. (Monad m, MonadSubscribeEvent t m, MonadReflexHost t m, MonadRef m, Ref m ~ Ref IO) => PerformEventT t m a -> m (a, FireCommand t m) Source #

Run a PerformEventT action, returning a FireCommand that allows the caller to trigger Events while ensuring that performEvent actions are run at the appropriate time.