ZVON > References > Haskell reference
| Indexes | Syntax | >> Prelude << | Ratio | Complex | Numeric | Ix | Array | List | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random

Module: Prelude
Function: cycle
Type: [a] -> [a]
Description: it creates a circular list from a finite one
Related: iterate, repeat, replicate, take

Example 1

Input: take 10 (cycle [1,2,3])

Output: [1,2,3,1,2,3,1,2,3,1]

Example 2

Input: take 10 (cycle "ABC")

Output: "ABCABCABCA"