@@ -82,6 +82,11 @@ listen m = unsafeEff $ \es -> do
82 modifyMVar_ v0 $ \w0 -> let w = w0 <> w1 in w `seq` pure w
82 modifyMVar_ v0 $ \w0 -> let w = w0 <> w1 in w `seq` pure w
85+-- | Execute an action and append its output to the overall output of the
86+-- 'Writer', then return the final value along with a function of the recorded
89+-- @'listens' f m ≡ 'Data.Bifunctor.second' f '<$>' 'listen' m@
85listens :: (Writer w :> es, Monoid w) => (w -> b) -> Eff es a -> Eff es (a, b)
90listens :: (Writer w :> es, Monoid w) => (w -> b) -> Eff es a -> Eff es (a, b)
86listens f m = do
91listens f m = do
87 (a, w) <- listen m
92 (a, w) <- listen m