WriterEffect

Effect for logging values alongside computations

Effect for logging values alongside computations

Compared to traditional Writer monad which accumulates values by default this effect can be interpreted in different ways:

  • log values to the console or to a file as soon as they are produced
  • accumulate values in a list
Companion
object
class Object
trait Matchable
class Any
object all

Value members

Inherited methods

def EvalFold[A](f: A => Eval[Unit]): RightFold[A, Eval[Unit]]
Inherited from
WriterInterpretation
def IntoMonoidFold[M, A](f: A => M)(`evidence$1`: Monoid[M]): RightFold[A, M]
Inherited from
WriterInterpretation
def MonoidFold[A](`evidence$2`: Monoid[A]): RightFold[A, A]
Inherited from
WriterInterpretation
def runWriter[R, U, O, A, B](w: Eff[R, A])(m: Aux[[_] =>> Writer[O, _$3], R, U]): Eff[U, (A, List[O])]

run a writer effect and return the list of written values

run a writer effect and return the list of written values

This uses a ListBuffer internally to append values

Inherited from
WriterInterpretation
def runWriterEval[R, U, O, A](w: Eff[R, A])(f: O => Eval[Unit])(m: Aux[[_] =>> Writer[O, _$10], R, U], ev: MemberIn[[A] =>> Eval[A], U]): Eff[U, A]
Inherited from
WriterInterpretation
def runWriterFold[R, U, O, A, B](w: Eff[R, A])(fold: RightFold[O, B])(m: Aux[[_] =>> Writer[O, _$4], R, U]): Eff[U, (A, B)]

More general fold of runWriter where we can use a fold to accumulate values in a mutable buffer

More general fold of runWriter where we can use a fold to accumulate values in a mutable buffer

Inherited from
WriterInterpretation
def runWriterIntoMonoid[R, U, O, M, A](w: Eff[R, A])(f: O => M)(m: Aux[[_] =>> Writer[O, _$12], R, U], M: Monoid[M]): Eff[U, (A, M)]
Inherited from
WriterInterpretation
def runWriterMonoid[R, U, O, A](w: Eff[R, A])(m: Aux[[_] =>> Writer[O, _$11], R, U], O: Monoid[O]): Eff[U, (A, O)]
Inherited from
WriterInterpretation
def runWriterUnsafe[R, U, O, A](w: Eff[R, A])(f: O => Unit)(m: Aux[[_] =>> Writer[O, _$7], R, U]): Eff[U, A]

Run a side-effecting fold

Run a side-effecting fold

Inherited from
WriterInterpretation
def tell[R, O](o: O)(member: MemberIn[[_] =>> Writer[O, _$1], R]): Eff[R, Unit]

write a given value

write a given value

Inherited from
WriterCreation

Implicits

Inherited implicits

implicit def ListFold[A]: RightFold[A, List[A]]
Inherited from
WriterInterpretation