Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module provides EventWriterT
, the standard implementation of
EventWriter
.
Synopsis
- newtype EventWriterT t w m a = EventWriterT {
- unEventWriterT :: StateT (EventWriterState t w) m a
- runEventWriterT :: forall t m w a. (Reflex t, Monad m, Semigroup w) => EventWriterT t w m a -> m (a, Event t w)
- 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)
- 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'))
- mapEventWriterT :: (forall x. m x -> n x) -> EventWriterT t w m a -> EventWriterT t w n a
- withEventWriterT :: (Semigroup w, Semigroup w', Reflex t, MonadHold t m) => (w -> w') -> EventWriterT t w m a -> EventWriterT t w' m a
Documentation
newtype EventWriterT t w m a Source #
A basic implementation of EventWriter
.
EventWriterT | |
|
Instances
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 #
Like runWithReplaceEventWriterTWith
, but for sequenceDMapWithAdjust
.
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
.