<div dir="ltr">On Wed, Jan 30, 2013 at 7:02 AM, Junior White <span dir="ltr">&lt;<a href="mailto:efiish@gmail.com" target="_blank">efiish@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Thanks for your reply!  I must learn more to fully understand what&#39;s going on inside the list comprehension. </div><div>But when I frist learn Haskell, it says sequence doesn&#39;t matter, but now it is a big matter, can compiler do some thing for us? I think this behavior is not friendly to newbies like me, I will take a very long time to work through it.</div>
</div></div></div></blockquote><div><br></div><div>No, the compiler can&#39;t help you here.  The compiler is not an oracle; even if it could invert your calculation (effectively swapping the loops around), it can&#39;t know which one is more appropriate.</div>
<div><br></div><div>As to sequences:  sequence doesn&#39;t matter indeed; data dependencies matter, and loop ordering imposes a data dependency because loops in Haskell are encoded as data structures (lists).</div><div><br>
</div></div>-- <br><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div>
<div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div>
</div>