<div dir="ltr">I really like the explanation of Haskell's non-strict evaluation from Parallel and Concurrent Programming in Haskell, reading this chapter will probably be sufficient and much easier than studying all of GHC's implementation details:<div>
<a href="http://chimera.labs.oreilly.com/books/1230000000929/ch02.html#sec_par-eval-whnf">http://chimera.labs.oreilly.com/books/1230000000929/ch02.html#sec_par-eval-whnf</a><br></div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Jun 6, 2014 at 10:15 PM, Kim-Ee Yeoh <span dir="ltr"><<a href="mailto:ky3@atamo.com" target="_blank">ky3@atamo.com</a>></span> wrote:<br><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=""><br><div class="gmail_quote">On Sat, Jun 7, 2014 at 11:14 AM, Xiaojun "Phil" Hu <span dir="ltr"><<a href="mailto:phil@cnphil.com" target="_blank">phil@cnphil.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> I found it relatively hard to reason about the time complexity of Haskell programs.</blockquote></div>


<br></div>Is that the question you really want to ask? <br><br>If it is, the answer is trivial: if it's O(f(n)) time in other languages, it's also O(f(n)) time in Haskell. (Note: space is a different story.)<br><br>
But what typically people want to know is: why is my program so slow? <br>

<br>You wonder about the constants covered up by Big-Oh. <br><br>And so you're going to have to get acquainted with<br><br>0) lambda calculus<br>1) graph reduction, <br>2) the G-machine, and <br>3) the spineless-tagless variant thereof. <br>


<br>You're also going to have to learn to read Core and understand some of the higher order core-to-core optimizations that GHC performs.<span class="HOEnZb"><font color="#888888"><br><br><br clear="all"><div>-- Kim-Ee</div>

</font></span></div></div>
<br>_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div>