[SR-6864] Add a "cycle" method to the standard library #49413
Labels
feature
A feature request or implementation
good first issue
Good for newcomers
standard library
Area: Standard library umbrella
swift evolution proposal needed
Flag → feature: A feature that warrants a Swift evolution proposal
Additional Detail from JIRA
md5: ce3f8a07c6a7edad8e1997fb1e825980
Issue Description:
It is often useful to cycle over a sequence indefinitely. For example, just like you can write
zip(repeatElement("foo", count: Int.max), myArray)
andzip(1..., myArray)
, you could write {{zip([.grey,.white].cycle(), myArray)}}.The text was updated successfully, but these errors were encountered: