Hi all,<br><br>If you compile and run this:<br><br>&nbsp;&nbsp;&nbsp; main = do<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; putStrLn $ show $ take (last [0..]) [0..]<br><br>or simply run:<br><br>&nbsp;&nbsp;&nbsp; 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 &quot;last [0..]&quot; to never produce a value and the &quot;take&quot; function to never take from the [0..] list.<br>
<br>I found that line of code in a friend&#39;s &quot;Skype Message&quot;, 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 &quot;last [0..]&quot; it doesn&#39;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>