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. <b _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe