summaryrefslogtreecommitdiff
path: root/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html
diff options
context:
space:
mode:
Diffstat (limited to 'gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html')
-rw-r--r--gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html b/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html
index b81aa18b..fa1e5a06 100644
--- a/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html
+++ b/gemfeed/2010-05-07-lazy-evaluation-with-standarn-ml.html
@@ -62,10 +62,10 @@ h2, h3 {
`||||
</pre>
<p class="quote"><i>Written by Paul Buetow 2010-05-07</i></p>
-<p>In contrast to Haskell, Standard SML does not use lazy evaluation by default, but eager evaluation. </p>
+<p>In contrast to Haskell, Standard SML does not use lazy evaluation by default but an eager evaluation. </p>
<a class="textlink" href="https://en.wikipedia.org/wiki/Eager_evaluation">https://en.wikipedia.org/wiki/Eager_evaluation</a><br />
<a class="textlink" href="https://en.wikipedia.org/wiki/Lazy_evaluation">https://en.wikipedia.org/wiki/Lazy_evaluation</a><br />
-<p>You can solve certain problems with lazy evaluation easier than with eager evaluation. For example, you might want to list the number Pi or another infinite list of something. With the help of lazy evaluation each element of the list is calculated when it is accessed first, but not earlier.</p>
+<p>You can solve specific problems with lazy evaluation easier than with eager evaluation. For example, you might want to list the number Pi or another infinite list of something. With the help of lazy evaluation, each element of the list is calculated when it is accessed first, but not earlier.</p>
<h2>Emulating lazy evaluation in SML</h2>
<p>However, it is possible to emulate lazy evaluation in most eager evaluation languages. This is how it is done with Standard ML (with some play with an infinite list of natural number tuples filtering out 0 elements):</p>
<pre>
@@ -109,7 +109,7 @@ val test = first 10 (nat_pairs_not_null ());
</pre>
<a class="textlink" href="http://smlnj.org/">http://smlnj.org/</a><br />
<h2>Real laziness with Haskell </h2>
-<p>As Haskell already uses lazy evaluation by default, there is no need to construct a new data type. Lists in Haskell are lazy by default. You will notice that the code is also much shorter and easier to understand than the SML version because of that. </p>
+<p>As Haskell already uses lazy evaluation by default, there is no need to construct a new data type. Lists in Haskell are lazy by default. You will notice that the code is also much shorter and easier to understand than the SML version. </p>
<pre>
{- Just to make it look like the ML example -}
first = take