A sequence that cycles between each of the items in a given sequence.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Sources/Cycle
.gitignore Initial commit Jan 14, 2019
LICENSE.md Initial commit Jan 14, 2019
Package.swift
README.md

README.md

Cycle

A sequence that cycles between each of the items in a given sequence.

for (number, parity) in zip(0..<5, ["even", "odd"].cycled()) {
    print(number, parity)
}
// Prints:
// 0 even
// 1 odd
// 2 even
// 3 odd
// 4 even

License

MIT

Contact

Mattt (@mattt)