cycle

fun <T> Iterable<T>.cycle(): Sequence<T>

Make an iterator returning elements from the iterable and saving a copy of each. When the iterable is exhausted, return elements from the saved copy. Repeats indefinitely.