ZVON > References > Haskell reference |
Intro / Search / ZVON |
| 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 ] |
Input: take 10 [13..]
Output: [13,14,15,16,17,18,19,20,21,22]
Input: take 10 ['F'..]
Output: "FGHIJKLMNO"
Input: [False ..]
Output: [False,True]
Input: take 10 [1,5 ..]
Output: [1,5,9,13,17,21,25,29,33,37]
Input: take 10 ['A','F' ..]
Output: "AFKPUZ_din"
Input: [13..23]
Output: [13,14,15,16,17,18,19,20,21,22,23]
Input: ['a'..'z']
Output: "abcdefghijklmnopqrstuvwxyz"
Input: [1,4 .. 30]
Output: [1,4,7,10,13,16,19,22,25,28]
Input: ['A','I'..'z']
Output: "AIQYaiqy"