Equivalent to:
fun <T> sequence(
block: suspend SequenceScope<T>.() -> Unit
): Sequence<T>
For buildSequence
we have:
fun <T> buildSequence(
block: suspend Yieldable<T>.() -> Unit
): Sequence<T>
A custom implementation of buildSequence() similar to existing Kotlin sequence() that builds a Sequence lazily yielding values one by one.
Kotlin