Generalisation of Recurse and StateRecurse
Generalisation of Recurse and StateRecurse
Helper trait for computations which might produce several M[X] in a stack of effects.
Helper trait for computations which might produce several M[X] in a stack of effects.
Either we can produce an X to pass to a continuation or we're done
Helper trait for computations which might produce several M[X] in a stack of effects and which need to keep some state around
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[M |: R, A] returns an A, this one can be combined with the last state value to produce a B
interpret the effect M in the M |: R stack
interpret the effect M in the M |: R stack
simpler version of interpret where the pure value is just mapped to another type
simpler version of interpret where the pure value is just mapped to another type
generalization of interpret and interpretState
generalization of interpret and interpretState
This method contains a loop which is stack-safe
interpret the effect M in the M |: R stack, keeping track of some state
interpret the effect M in the M |: R stack, keeping track of some state
simpler version of interpret1 where the pure value is just mapped to another type
simpler version of interpret1 where the pure value is just mapped to another type