
3 Apr
2008
3 Apr
'08
5:35 p.m.
Olivier Boudry wrote:
main = do putStrLn $ show $ take (last [0..]) [0..]
or simply run:
take (last [0..]) [0..]
in ghci, it first hang for about one minute and then starts to generate an infinite list.
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.