G'day all.

Quoting "Richard A. O'Keefe" <[EMAIL PROTECTED]>:

I'm currently arguing that lists:seq(1, 0) should be [],
not an exception.  Oddly enough, I'm being beaten over the
head with Haskell, of all things.
[...]
Does anyone remember why the definition of enumFromTo is the way it is?

I don't know if this is the reason, but there's another nice property
that enumerations have, namely:

    [p..q-1] ++ [q..r-1] == [p..r-1]  -- if p <= q <= r

If you think of the abstract semantics of ranges, this makes perfect
sense.  There needs to be a notation for empty ranges.

Having said that, I don't know of a good reason why [5,5..5] is an
infinte list of 5's.

Cheers,
Andrew Bromage
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to