title: Which stage make difference between call-by-name and call-by-value?
body: <p>Most of other language use call-by-value. Haskell use call-by-name (lazy evaluation), I'm wonder how does it runs and I think it will be better compare with call-by-value.  </p>
  
  <p>Take a example with the question,<br>
  the repeat' function defined as this:</p>
  
  <pre><code>repeat' :: a -&gt; [a]   
  repeat' x = x:repeat' x
  </code></pre>
  
  <p>use <code>repeat' 3</code> will get a unlimited list of 3,<br>
  <code>ghci&gt; repeat' 3</code> will generate 3 continuous,<br>
   but <code>take 5 (repeat' 3)</code> will just get <code>[3,3,3,3,3]</code>.<br>
  how does the haskell know end with fifth recursion inner <code>repeat'</code> function? Besides, I don't think it's a matter of <code>take</code>.  </p>
  
  <p>When the code be executed which stage it difference with call-by-value?  </p>
  
  <p>thanks</p>