I so wanted 10.downto , or 10.times, and couldn't for the life of me think how to just get a list of numbers or loop without explicit recursion...
[1 .. n]desugars to
enumFromTo 1 n. infinite lists:
[1 .. ]desugars to
enumFrom 1. works for any
Enum tso you can write
['a' .. 'z']to get all lowercase letters.
iterateare the building blocks of any control structure you can do with a loop.
iterate pred 10 = [10, 9 .. ]
Prelude> [1 .. 10] [1,2,3,4,5,6,7,8,9,10] Prelude> [10 .. 1] 
enumFrom x = map toEnum [fromEnum x ..]