<br><br><div><span class="gmail_quote">On 2/10/07, <b class="gmail_sendername">Creighton Hogg</b> <<a href="mailto:wchogg@gmail.com">wchogg@gmail.com</a>> 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> <<a href="mailto:lennart@augustsson.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
lennart@augustsson.net</a>> 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. So<br>that makes from Integral and floor very slow.<br>* foldl' 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' too strict? I don't think I understand? </div></div></blockquote><div>I think I can explain my confusion better. For a finite list, I thought a fold would always pass through the entire list. I take it that what you mean is that, since the fold is over an &&, then it can bail as soon as it encounters the first false, but it only does that if it's allowed to not be strict. I suppose this reveals my ignorance of how laziness really works.
<br></div></div>