A chain with possibly mutable state. The state must not be changed outside the chain. Two chins should never share the state.
the state of the chain.
the function to copy current state without modifying it.
Create a copy of current chain state. Consuming resulting chain does not affect initial chain.
Generate next value, changing state if needed