Stateful Chain
class StatefulChain<S, out R>(state: S, seed: S.() -> R, forkState: (S) -> S, gen: suspend S.(R) -> R) : Chain<R>
A chain with possibly mutable state. The state must not be changed outside the chain. Two chins should never share the state.
Parameters
S
the state of the chain.
fork State
the function to copy current state without modifying it.