Hi all,<br><br>If you compile and run this:<br><br> main = do<br> putStrLn $ show $ take (last [0..]) [0..]<br><br>or simply run:<br><br> take (last [0..]) [0..]<br><br> in ghci, it first hang for about one minute and then starts to generate an infinite list. I was expecting "last [0..]" to never produce a value and the "take" function to never take from the [0..] list.<br>
<br>I found that line of code in a friend's "Skype Message", lauched it in
ghci and forgot it. When I came back to my ghci window a couple minutes
later it was listing numbers, which was really unexpected.<br><br>If I just run "last [0..]" it doesn't return a value and my computer will quickly start to paginate to death. Am I missing something? Some laziness magic? Rewrite rules?<br>
<br>Thanks,<br><br>Olivier.<br>