<br><br><div><span class="gmail_quote">On 2/10/07, <b class="gmail_sendername">Creighton Hogg</b> &lt;<a href="mailto:wchogg@gmail.com">wchogg@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br><div><span class="q"><span class="gmail_quote">On 2/10/07, <b class="gmail_sendername">Lennart Augustsson</b> &lt;<a href="mailto:lennart@augustsson.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
lennart@augustsson.net</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
There are many things that makes your code slow.<br>* The default for Haskell is to compute with Integer, not Int.&nbsp;&nbsp;So<br>that makes from Integral and floor very slow.<br>* foldl&#39; is a bad choice, because it is too strict, you want to abort
<br>the loop as soon as possible.</blockquote></span><div><br>Now why is foldl&#39; too strict?&nbsp; I don&#39;t think I understand? </div></div></blockquote><div>I think I can explain my confusion better.&nbsp; For a finite list, I thought a fold would always pass through the entire list.&nbsp; I take it that what you mean is that, since the fold is over an &amp;&amp;, then it can bail as soon as it encounters the first false, but it only does that if it&#39;s allowed to not be strict.&nbsp; I suppose this reveals my ignorance of how laziness really works.
<br></div></div>