[Haskell-cafe] Shorthand method of enumerating a list a gotcha ... or is it just me?

Roel van Dijk vandijk.roel at gmail.com
Fri May 7 18:20:33 EDT 2010


>From the Haskell 98 report (section 6.3.4):

> For Float and Double, the semantics of the enumFrom  family is given by the rules for Int above, except that the list terminates when the elements become greater than e3+i/2  for positive increment i, or > when they become less than e3+i/2  for negative i.

So yes, it is surprising, but according to the specification. But then
again the very concept of a type like Float having an Enum instance is
a bit weird.


More information about the Haskell-Cafe mailing list