@@ -20,6 +20,7 @@ module Reflex.EventWriter
20 , EventWriter (..)
20 , EventWriter (..)
21 , runWithReplaceEventWriterTWith
21 , runWithReplaceEventWriterTWith
22 , sequenceDMapWithAdjustEventWriterTWith
22 , sequenceDMapWithAdjustEventWriterTWith
25import Reflex.Class
26import Reflex.Class
@@ -267,3 +268,16 @@ instance (MonadQuery t q m, Monad m) => MonadQuery t q (EventWriterT t w m) wher
267 tellQueryIncremental = lift . tellQueryIncremental
268 tellQueryIncremental = lift . tellQueryIncremental
268 askQueryResult = lift askQueryResult
269 askQueryResult = lift askQueryResult
269 queryIncremental = lift . queryIncremental
270 queryIncremental = lift . queryIncremental
272+-- | Map a function over the output of a 'EventWriterT'.
273+withEventWriterT :: (Semigroup w, Semigroup w', Reflex t, MonadHold t m, MonadFix m)
275+ -> EventWriterT t w m a
276+ -> EventWriterT t w' m a
277+withEventWriterT f ew = do
279+ (r, e) <- runEventWriterT ew