<div dir="ltr">Hi Heinrich,<div><br></div><div>Thanks for confirming my concepts. It took me a long time pondering over what it meant to be purely functional.</div><div>Great articles btw (+1).</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 16 March 2015 at 19:41, Heinrich Apfelmus <span dir="ltr"><<a href="mailto:apfelmus@quantentunnel.de" target="_blank">apfelmus@quantentunnel.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Karl Voelker wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Sun, Mar 15, 2015, at 09:17 AM, Simon Kitching wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
And AIUI the Haskell compiler/runtime can postpone evaluation of any function (laziness), or reorder function calls whever it thinks this good.<br>
</blockquote>
<br>
It's not that it "can" but that it must. Haskell's evaluation strategy<br>
is a part of the language specification.<br>
<br>
Consider this expression:<br>
<br>
let f = 1 : f in take 5 f<br>
<br>
You can paste this into ghci and feel confident that it's going to<br>
terminate. You're not at the whim of the runtime.<br>
<br>
I think you may find these articles interesting:<br>
<br>
<a href="https://wiki.haskell.org/Lazy_evaluation" target="_blank">https://wiki.haskell.org/Lazy_<u></u>evaluation</a><br>
<a href="https://wiki.haskell.org/Non-strict_semantics" target="_blank">https://wiki.haskell.org/Non-<u></u>strict_semantics</a><br>
</blockquote>
<br></span>
Strictly speaking, the Haskell language standard only specifies that Haskell has non-strict semantics, not that it needs to be evaluated using lazy evaluation.<br>
<br>
Of course, the two are related. I have tried to expand on the details here:<br>
<br>
  <a href="https://hackhands.com/non-strict-semantics-haskell" target="_blank">https://hackhands.com/non-<u></u>strict-semantics-haskell</a><span class="im HOEnZb"><br>
<br>
<br>
Best regards,<br>
Heinrich Apfelmus<br>
<br>
--<br>
<a href="http://apfelmus.nfshost.com" target="_blank">http://apfelmus.nfshost.com</a><br>
<br></span><div class="HOEnZb"><div class="h5">
______________________________<u></u>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" target="_blank">http://mail.haskell.org/cgi-<u></u>bin/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div>Regards</div><div dir="ltr"><div><br></div><div>Sumit Sahrawat</div></div></div></div></div></div></div>
</div>