[Haskell-cafe] Shouldn't this loop indefinitely => take (last [0..]) [0..]

Olivier Boudry olivier.boudry at gmail.com
Thu Apr 3 18:03:31 EDT 2008

On Thu, Apr 3, 2008 at 10:35 PM, Bryan O'Sullivan <bos at serpentine.com>

> It's not an infinite list.  It's a list of length maxBound::Int, as
> required by the fact that take's first argument is an Int.  The second
> argument is probably defaulting to Integer.
Right! The first arg of "take" makes the first list into a int list. I did
not wait long enough to see the end of the list and I'm so used to represent
infinite lists with [0..] that I didn't think it could be limited.

Thanks for the explanation!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080403/77afb60e/attachment.htm

More information about the Haskell-Cafe mailing list