Note that, for example, the Python Range Specifier is a function:
>>> range(1, 12, 2) [1, 3, 5, 7, 9, 11]
Haskell aims to provide syntax that literally looks as if you could write a list for another person by writing .. instead of the "obvious" template:
ghci> [1, 3 .. 11] [1,3,5,7,9,11]
Another point (raised by Carl in the comment to the answer on the left) is that the sequence syntax can be used for non-numeric types, where there is no such easy way to write a "step":
ghci> ['a', 'f' .. 'z'] "afkpuz"
Ben
source share