arrow-mtl / arrow.mtl.typeclasses / MonadWriter

MonadWriter

interface MonadWriter<F, W> : Monad<F>

A monad that support monoidal accumulation (e.g. logging List of String)

Functions

censor open fun <A> Kind<F, A>.censor(f: (W) -> W): Kind<F, A>
Modify the accumulator
listen abstract fun <A> Kind<F, A>.listen(): Kind<F, Tuple2<W, A>>
Run the effect and pair the accumulator with the result
listens open fun <A, B> Kind<F, A>.listens(f: (W) -> B): Kind<F, Tuple2<B, A>>
Pair the value with an inspection of the accumulator
pass abstract fun <A> Kind<F, Tuple2<(W) -> W, A>>.pass(): Kind<F, A>
Apply the effectful function to the accumulator
tell open fun tell(w: W): Kind<F, Unit>
Lift the log into the effect
writer abstract fun <A> writer(aw: Tuple2<W, A>): Kind<F, A>
Lift a writer action into the effect

Inheritors

WriterTMonadWriter interface WriterTMonadWriter<F, W> : MonadWriter<WriterTPartialOf<F, W>, W>, WriterTMonad<F, W>

Type Class Hierarchy