StateRecurse

trait StateRecurse[M[_], A, B]

Helper trait for computations which might produce several M[X] in a stack of effects and which need to keep some state around

This is typically the case for Writer or State which need to keep some state S after each evaluation Evaluating the effect M[X] might use the previous S value as shown in the apply method

Finally when the Eff[R, A] returns an A, this one can be combined with the last state value to produce a B

class Object
trait Matchable
class Any

Type members

Types

type S

Value members

Abstract methods

def applicative[X, T[_] : Traverse](xs: T[M[X]], s: S): Either[(T[X], S), (M[T[X]], S)]
def apply[X](x: M[X], s: S): (X, S)
def finalize(a: A, s: S): B

Abstract fields

val init: S