Returns a sequence formed from
first and repeated lazy applications of
- Xcode 8.0+
- Swift Standard Library
The first element to be returned from the sequence.
A closure that accepts the previous sequence element and returns the next element.
A sequence that starts with
first and continues with every value returned by passing the previous element to
The first element in the sequence is always
first, and each successive element is the result of invoking
next with the previous element. The sequence ends when
next never returns
nil, the sequence is infinite.
This function can be used to replace many cases that were previously handled using C-style