@@ -19,6 +19,7 @@ module Reflex.EventWriter
19 , EventWriter (..)
19 , EventWriter (..)
20 , runWithReplaceEventWriterTWith
20 , runWithReplaceEventWriterTWith
21 , sequenceDMapWithAdjustEventWriterTWith
21 , sequenceDMapWithAdjustEventWriterTWith
24import Reflex.Class
25import Reflex.Class
@@ -176,3 +177,16 @@ instance (MonadQuery t q m, Monad m) => MonadQuery t q (EventWriterT t w m) wher
176 tellQueryIncremental = lift . tellQueryIncremental
177 tellQueryIncremental = lift . tellQueryIncremental
177 askQueryResult = lift askQueryResult
178 askQueryResult = lift askQueryResult
178 queryIncremental = lift . queryIncremental
179 queryIncremental = lift . queryIncremental
181+-- | Map a function over the output of a 'EventWriterT'.
182+withEventWriterT :: (Monoid w, Monoid w', Reflex t, MonadHold t m, MonadFix m)
184+ -> EventWriterT t w m a
185+ -> EventWriterT t w' m a
186+withEventWriterT f ew = do
188+ (r, e) <- runEventWriterT ew