[Haskell-cafe] Odd list comprehension behaviour

Tom Ellis tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Thu Mar 17 18:28:39 UTC 2016


On Thu, Mar 17, 2016 at 03:58:06AM +0100, Krisztian Pinter wrote:
> I noticed some odd behaviour with list comprehensions.
> 
> [1..1] == [1]
> BUT
> [1,1..1] == [1..]

I think list enumerations are one of those things that would not make it
into Haskell today, if we were inventing it from scratch.

My (perhaps minority) opinion is that they should be avoided.

Tom


More information about the Haskell-Cafe mailing list