runWriter -package:effectful-core

Unwrap a writer computation as a (result, output) pair. (The inverse of writer.)
Unwrap a writer computation as a (result, output) pair. (The inverse of writer.)
Run a Writer effect in the style of WriterT (but without the nasty space leak!)
Encapsulation of a writer computation, providing the accumulated output. Typical usage in arrow notation:
proc p -> do
...
(result, output) <- (|runWriter cmd|)
Run a Writer effect with a Monoidal log, applying a continuation to the final log and result.
runWriter k (pure a) = k mempty a
runWriter k (tell w) = k w ()
runWriter k (listen (tell w)) = k w (w, ())
runWriter k (censor f (tell w)) = k (f w) ()
Run a Writer effect with a Monoidal log, producing the final log alongside the result value.
runWriter (tell w) = pure (w, ())
runWriter (pure a) = pure (mempty, a)
Run a Writer effect in the style of WriterT (but without the nasty space leak!)
>>> getAny $ snd $ runPureEff $ runWriter $ \w -> do
-- Non-empty list (the tell event does happen)
for_ [1 .. 10] $ \_ -> tell w (Any True)
True
Unwrap a writer computation. (The inverse of writerT.)
Run WriterT in the base monad Since 1.0.11
Run WriterT in the base monad Since 1.0.11
Run a block using a MonadLogger instance. Return a value and logs in a list | @since 0.3.28
Run WriterT in the base monad
A variant of runWriterTVar where an STM action is used instead of a TVar to commit tells.
Like runWriter, but right-associates uses of <>. This asymptotically improves performance if the time complexity of <> for the Monoid depends only on the size of the first argument. You should always use this instead of runWriter if the monoid is a list, such as String.
Transform a Writer effect into atomic operations over a TVar through final IO.
Like runWriter, but right-associates uses of <>. This asymptotically improves performance if the time complexity of <> for the Monoid depends only on the size of the first argument. You should always use this instead of runWriter if the monoid is a list, such as String.
Transform a Writer effect into atomic operations over a TVar through final IO.
Run the effects of the WriterT monad, collecting all its output in the second element of the tuple.
Run WriterT in the base monad Since 1.0.11