Module Core_kernel.Sequence.Step

A Step describes the next step of the sequence construction. Done indicates the sequence is finished. Skip indicates the sequence continues with another state without producing the next element yet. Yield outputs an element and introduces a new state.

Modifying 's doesn't violate any *internal* invariants, but it may violate some undocumented expectations. For example, one might expect that producing an element from the same point in the sequence would always give the same value, but if the state can mutate, that is not so.

type ('a, 's) t =
| Done
| Skip of 's
| Yield of 'a * 's
include sig ... end
val sexp_of_t : ('a ‑> Base.Sexp.t) ‑> ('s ‑> Base.Sexp.t) ‑> ('a'st ‑> Base.Sexp.t