UnfoldSequence
A sequence whose elements are produced via repeated applications of a closure to some mutable state.
Declaration
@frozen struct UnfoldSequence<Element, State>Overview
The elements of the sequence are computed lazily and the sequence may potentially be infinite in length.
Instances of UnfoldSequence are created with the functions sequence(first:next:) and sequence(state:next:).