reflex-0.9.3.1: Higher-order Functional Reactive Programming
Safe HaskellSafe-Inferred
LanguageHaskell2010

Reflex.EventWriter.Base

Description

This module provides EventWriterT, the standard implementation of EventWriter.

Synopsis

Documentation

newtype EventWriterT t w m a Source #

A basic implementation of EventWriter.

Constructors

EventWriterT 

Fields

Instances

Instances details
MonadHold t m => MonadHold (t :: Type) (EventWriterT t w m) Source # 
Instance details

Defined in Reflex.EventWriter.Base

Methods

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

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

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

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

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

now :: EventWriterT t w m (Event t ()) Source #

MonadSample t m => MonadSample (t :: Type) (EventWriterT t w m) Source # 
Instance details

Defined in Reflex.EventWriter.Base

Methods

sample :: Behavior t a -> EventWriterT t w m a Source #

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

Defined in Reflex.EventWriter.Base

Methods

tellDyn :: Dynamic t w -> EventWriterT t v m () Source #

(Reflex t, Monad m, Semigroup w) => EventWriter t w (EventWriterT t w m) Source # 
Instance details

Defined in Reflex.EventWriter.Base

Methods

tellEvent :: Event t w -> EventWriterT t w m () Source #

(MonadQuery t q m, Monad m) => MonadQuery t q (EventWriterT t w m) Source # 
Instance details

Defined in Reflex.EventWriter.Base

MFunctor (EventWriterT t w :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Reflex.EventWriter.Base

Methods

hoist :: forall m n (b :: k). Monad m => (forall a. m a -> n a) -> EventWriterT t w m b -> EventWriterT t w n b #

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

Defined in Reflex.EventWriter.Base

Methods

ask :: EventWriterT t w m r #

local :: (r -> r) -> EventWriterT t w m a -> EventWriterT t w m a #

reader :: (r -> a) -> EventWriterT t w m a #

(Reflex t, Adjustable t m, MonadHold t m, Semigroup w) => Adjustable t (EventWriterT t w m) Source # 
Instance details

Defined in Reflex.EventWriter.Base

Methods

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

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

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

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

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

Defined in Reflex.EventWriter.Base

Methods

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

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

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

Defined in Reflex.NotReady.Class

Methods

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

notReady :: EventWriterT t w m () Source #

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

Defined in Reflex.EventWriter.Base

Associated Types

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

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

Defined in Reflex.EventWriter.Base

Methods

getPostBuild :: EventWriterT t w m (Event t ()) Source #

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

Defined in Reflex.EventWriter.Base

Associated Types

type Request (EventWriterT t w m) :: Type -> Type Source #

type Response (EventWriterT t w m) :: Type -> Type Source #

Methods

requesting :: Event t (Request (EventWriterT t w m) a) -> EventWriterT t w m (Event t (Response (EventWriterT t w m) a)) Source #

requesting_ :: Event t (Request (EventWriterT t w m) a) -> EventWriterT t w m () 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 #

MonadTrans (EventWriterT t w) Source # 
Instance details

Defined in Reflex.EventWriter.Base

Methods

lift :: Monad m => m a -> EventWriterT t w m a #

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

Defined in Reflex.EventWriter.Base

Methods

mfix :: (a -> EventWriterT t w m a) -> EventWriterT t w m a #

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

Defined in Reflex.EventWriter.Base

Methods

liftIO :: IO a -> EventWriterT t w m a #

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

Defined in Reflex.EventWriter.Base

Methods

pure :: a -> EventWriterT t w m a #

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

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

(*>) :: EventWriterT t w m a -> EventWriterT t w m b -> EventWriterT t w m b #

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

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

Defined in Reflex.EventWriter.Base

Methods

fmap :: (a -> b) -> EventWriterT t w m a -> EventWriterT t w m b #

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

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

Defined in Reflex.EventWriter.Base

Methods

(>>=) :: EventWriterT t w m a -> (a -> EventWriterT t w m b) -> EventWriterT t w m b #

(>>) :: EventWriterT t w m a -> EventWriterT t w m b -> EventWriterT t w m b #

return :: a -> EventWriterT t w m a #

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

Defined in Reflex.EventWriter.Base

Methods

mask :: ((forall a. EventWriterT t w m a -> EventWriterT t w m a) -> EventWriterT t w m b) -> EventWriterT t w m b #

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

Defined in Reflex.EventWriter.Base

Methods

throw :: Exception e => e -> EventWriterT t w m a #

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

finally :: EventWriterT t w m a -> EventWriterT t w m b -> EventWriterT t w m a #

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

Defined in Reflex.EventWriter.Base

Methods

catch :: (HasCallStack, Exception e) => EventWriterT t w m a -> (e -> EventWriterT t w m a) -> EventWriterT t w m a #

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

Defined in Reflex.EventWriter.Base

Methods

mask :: HasCallStack => ((forall a. EventWriterT t w m a -> EventWriterT t w m a) -> EventWriterT t w m b) -> EventWriterT t w m b #

uninterruptibleMask :: HasCallStack => ((forall a. EventWriterT t w m a -> EventWriterT t w m a) -> EventWriterT t w m b) -> EventWriterT t w m b #

generalBracket :: HasCallStack => EventWriterT t w m a -> (a -> ExitCase b -> EventWriterT t w m c) -> (a -> EventWriterT t w m b) -> EventWriterT t w m (b, c) #

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

Defined in Reflex.EventWriter.Base

Methods

throwM :: (HasCallStack, Exception e) => e -> EventWriterT t w m a #

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

Defined in Reflex.EventWriter.Base

Associated Types

type PrimState (EventWriterT t w m) #

Methods

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

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

Defined in Reflex.EventWriter.Base

Methods

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

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

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

Defined in Reflex.EventWriter.Base

Associated Types

type Ref (EventWriterT t w m) :: Type -> Type #

Methods

newRef :: a -> EventWriterT t w m (Ref (EventWriterT t w m) a) #

readRef :: Ref (EventWriterT t w m) a -> EventWriterT t w m a #

writeRef :: Ref (EventWriterT t w m) a -> a -> EventWriterT t w m () #

modifyRef :: Ref (EventWriterT t w m) a -> (a -> a) -> EventWriterT t w m () #

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

type PrimState (EventWriterT t w m) Source # 
Instance details

Defined in Reflex.EventWriter.Base

type Ref (EventWriterT t w m) Source # 
Instance details

Defined in Reflex.EventWriter.Base

type Ref (EventWriterT t w m) = Ref m
type Performable (EventWriterT t w m) Source # 
Instance details

Defined in Reflex.EventWriter.Base

type Request (EventWriterT t w m) Source # 
Instance details

Defined in Reflex.EventWriter.Base

type Request (EventWriterT t w m) = Request m
type Response (EventWriterT t w m) Source # 
Instance details

Defined in Reflex.EventWriter.Base

type Response (EventWriterT t w m) = Response m

runEventWriterT :: forall t m w a. (Reflex t, Monad m, Semigroup w) => EventWriterT t w m a -> m (a, Event t w) Source #

Run a EventWriterT action.

runWithReplaceEventWriterTWith :: forall m t w a b. (Reflex t, MonadHold t m, Semigroup w) => (forall a' b'. m a' -> Event t (m b') -> EventWriterT t w m (a', Event t b')) -> EventWriterT t w m a -> Event t (EventWriterT t w m b) -> EventWriterT t w m (a, Event t b) Source #

Given a function like runWithReplace for the underlying monad, implement runWithReplace for EventWriterT. This is necessary when the underlying monad doesn't have a Adjustable instance or to override the default Adjustable behavior.

sequenceDMapWithAdjustEventWriterTWith :: forall t m p p' w k v v'. (Reflex t, MonadHold t m, Semigroup w, Patch (p' (Some k) (Event t w)), PatchTarget (p' (Some k) (Event t w)) ~ Map (Some k) (Event t w), GCompare k, Patch (p' (Some k) w), PatchTarget (p' (Some k) w) ~ Map (Some k) w) => ((forall a. k a -> v a -> m (Compose ((,) (Event t w)) v' a)) -> DMap k v -> Event t (p k v) -> EventWriterT t w m (DMap k (Compose ((,) (Event t w)) v'), Event t (p k (Compose ((,) (Event t w)) v')))) -> ((forall a. Compose ((,) (Event t w)) v' a -> v' a) -> p k (Compose ((,) (Event t w)) v') -> p k v') -> ((forall a. Compose ((,) (Event t w)) v' a -> Event t w) -> p k (Compose ((,) (Event t w)) v') -> p' (Some k) (Event t w)) -> (Incremental t (p' (Some k) (Event t w)) -> Event t (PatchTarget (p' (Some k) w))) -> (Event t (p' (Some k) (Event t w)) -> Event t (p' (Some k) w)) -> (forall a. k a -> v a -> EventWriterT t w m (v' a)) -> DMap k v -> Event t (p k v) -> EventWriterT t w m (DMap k v', Event t (p k v')) Source #

mapEventWriterT :: (forall x. m x -> n x) -> EventWriterT t w m a -> EventWriterT t w n a Source #

Change the monad underlying an EventWriterT

withEventWriterT :: (Semigroup w, Semigroup w', Reflex t, MonadHold t m) => (w -> w') -> EventWriterT t w m a -> EventWriterT t w' m a Source #

Map a function over the output of a EventWriterT.