I'm reading Learn You A Haskell for Great Good. His examples [2,2..20]
and [3, 6..20]
work fine but I got three weird results:
- Count by 17's from one to 171:
[17, 1..171]
yields the null list. - Count by 17's from seventeen to 1711111:
[17, 17..171111]
repeats the number17
until I interrupt GHCi. There is a weird difference between
take 54 [171, 234..]
andtake 54 [171, 244..]
:ghci> take 54 [171, 234..] [171,234,297,360,423,486,549,612,675,738,801,864,927,990,1053,1116,1179,1242,1305,1368,1431,1494,1557,1620,1683,1746,1809,1872,1935,1998,2061,2124,2187,2250,2313,2376,2439,2502,2565,2628,2691,2754,2817,2880,2943,3006,3069,3132,3195,3258,3321,3384,3447,3510] ghci> take 54 [171, 244..] [171,244,317,390,463,536,609,682,755,828,901,974,1047,1120,1193,1266,1339,1412,1485,1558,1631,1704,1777,1850,1923,1996,2069,2142,2215,2288,2361,2434,2507,2580,2653,2726,2799,2872,2945,3018,3091,3164,3237,3310,3383,3456,3529,3602,3675,3748,3821,3894,3967,4040]
Why?