[Haskell-cafe] [m..n] question

ajb at spamcop.net ajb at spamcop.net
Sun Sep 21 23:35:44 EDT 2008


Quoting wren ng thornton <wren at freegeek.org>:

> I'm sure you know *why* it's an infinite list[1], but as for why that's
> useful I can't say. It has the feel of a bug in implementation, though
> it is ...consistent.

Right.  I have no problem with [5,5..5] being logically an anamorphism,
but thinking abstractly about what I'd want it to mean, I'm pretty sure
I don't want it to mean an infinite list of 5's.

I asked a class of about a dozen bright undergrads about 10 years ago
what they thought it should mean, and IIRC the consensus seemed to be
split between [5] and [5,5].  Nobody correctly guessed what it actually
did.  So whether the behaviour is technically right or wrong, it violates
the Principle of Least Surprise.

Andrew Bromage

More information about the Haskell-Cafe mailing list