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

Chris Smith cdsmith at twu.net
Thu Apr 3 18:06:02 EDT 2008


Bryan O'Sullivan wrote:
> 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.

Which, incidentally, also explains why Don couldn't reproduce it on a 64-
bit system.  There, instead of hanging for about a minute before printing 
out the list, it would hang for about 4 billion minutes.

-- 
Chris Smith



More information about the Haskell-Cafe mailing list