Search code examples
haskellfunctional-programmingrange

Is it possible to change the step size of the built-in haskell range function or literal?


The default

[1..5]

gives this

[1,2,3,4,5]

and can also be done with the range function. Is it possible to change the step size between the points, so that I could get something like the following instead?

[1,1.5,2,2.5,3,3.5,4,4.5,5] 

Solution

  • [1,1.5..5]