[Haskell-cafe] Odd list comprehension behaviour

Richard A. O'Keefe ok at cs.otago.ac.nz
Thu Mar 17 04:48:40 UTC 2016


On 17/03/16 5:27 pm, Manuel Gómez wrote:
> 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.

 From experience in other programming languages, I don't have that 
intuition.
Indeed, from experience in Haskell, I don't expect [a,b..c] to end at c.
[1,3..6] ends at 5, not 6.



More information about the Haskell-Cafe mailing list