[Haskell-cafe] Odd list comprehension behaviour

Francesco Ariis fa-ml at ariis.it
Thu Mar 17 05:44:33 UTC 2016


On Wed, Mar 16, 2016 at 11:57:39PM -0430, Manuel Gómez wrote:
> On Wed, Mar 16, 2016 at 10:56 PM, Francesco Ariis <fa-ml at ariis.it> wrote:
> > The important bit being "the list terminates when the next element would
> > be greater than e3". Unfortunate in my opinion (I agree with you the
> > fact that `[1..1] /= [1,1..1]` is puzzling), but specs compliant
> >
> > [1] https://www.haskell.org/onlinereport/basic.html
> 
> I'm not necessarily proposing this, but would it not be also
> reasonable for this to read "the list terminates when the current
> element equals e3 or the next element would be greater than e3"?  It's
> slightly more wordy, but it captures the intuition that [a,b..c] ends
> at c.

Exactly! I am now tempted to fire in haskell-prime.


More information about the Haskell-Cafe mailing list