interpretS

inline fun <E : Effect<*>, S, A, B> Program<A>.interpretS(initialState: S, noinline transformDone: (S, A) -> Program<B>, noinline rule: (S, E, (S, Any?) -> Program<B>) -> Program<B>): Program<B>(source)

Handle and remove every effect of family E, threading state S from initialState through every step; transformDone sees the final state and value. resume takes the next state and the response, and is the rest of the program as in interpret, with the same forms and the same lazy application.


inline fun <E : Effect<*>, S, A> Program<A>.interpretS(initialState: S, noinline rule: (S, E, (S, Any?) -> Program<A>) -> Program<A>): Program<A>(source)

Handle and remove every effect of family E, threading state S from initialState; resume takes the next state and the response, and is the rest of the program as in interpret, with the same forms and the same lazy application.