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

Name arithmetic sequences
Description arithmetic sequences are defined for types which are instances of class Enum, [a..] is eqivalent to , [a,a..] to , [a..a] to , and [a,a..a] to .
Related:
Bibliography: List Comprehensions and Arithmetic Sequences [ A Gentle Introduction to Haskell ]
The Enumeration Class [ A Gentle Introduction to Haskell ]

Example 1

Input: take 10 [13..]

Output: [13,14,15,16,17,18,19,20,21,22]

Example 2

Input: take 10 ['F'..]

Output: "FGHIJKLMNO"

Example 3

Input: [False ..]

Output: [False,True]

Example 4

Input: take 10 [1,5 ..]

Output: [1,5,9,13,17,21,25,29,33,37]

Example 5

Input: take 10 ['A','F' ..]

Output: "AFKPUZ_din"

Example 6

Input: [13..23]

Output: [13,14,15,16,17,18,19,20,21,22,23]

Example 7

Input: ['a'..'z']

Output: "abcdefghijklmnopqrstuvwxyz"

Example 8

Input: [1,4 .. 30]

Output: [1,4,7,10,13,16,19,22,25,28]

Example 9

Input: ['A','I'..'z']

Output: "AIQYaiqy"