<div class="gmail_quote"><div>A summary of the changes I&#39;ve included so far:</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Under Declarative, you aren&#39;t creating a &quot;named expression, 2 + 2&quot;, really.<br>


You are redefining (+).<br>
<br></blockquote><div><br></div><div>Noted and reflected in the new version.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Under Lazy, your example of binding fib 30 is not a good example of<br>
memoization. With memoization you typically call the underlying computation<br>
the first time, and memoize it for repeated retrieval later, not hardwire in<br>
values at compile time. Here you never ever call the real fib at all. On top<br>
of everything else, it&#39;d be too easy to introduce a typo into one of your<br>
hardwired constant values.<br>
<br></blockquote><div><br></div><div>Noted and reflected in the new version. After several comments to this effect, I do not want to misrepresent memoization in the tutorial. Sometimes it is useful to be slightly inaccurate in a tutorial in order to help bridge the gap between someone with no experience in a something vs the wealth of knowledge and complexity in the thing itself. This is not one of those times, and fortunately, fixing the misrepresentation in my tutorial is as easy as removing the hardcoded call.</div>

<div><br></div><div>One thing I want to double check is that Haskell does, in fact, automatically memoize all pure function calls. Is this true?</div><div><br></div><div>I would still like to provide a performance comparison of the Fibonacci code with and without memoization, for readers who enjoy numerical evidence, using the Unix &quot;time&quot; command, but I don&#39;t know how to turn memoization off. I guess I would have to reimplement the algorithm in a way that can&#39;t make use of memoization. Any suggestions?</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Under Infinite, you should use &quot;sieve (n:ns)&quot; pattern matching instead of<br>
calling head.<br></blockquote><div><br></div><div>Thank you! I try to make use of Haskell pattern matching wherever I can. Since I needed to refer to the whole list, as well as the head and tail, I originally used &quot;head&quot; instead of pattern matching. Noted and reflected in the new version.</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Under Type-Safe<br>
Subtle distinction, but returning () is not the same as returning nothing<br>
at all.<br></blockquote><div><br></div><div>True. Noted and reflected in the new version. What&#39;s the Haskell name for () again? I fear explaining the exact type information of IO () may be too much for a brief introduction to Haskell to cover.</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
s/ommitted/omitted/<br></blockquote><div><br></div><div>Noted and reflected in the new version.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You&#39;ve got an unusual indentation scheme. Consider adopting a more standard<br>
one for your tutorial.<br></blockquote><div><br></div><div>I&#39;m in the camp of hard tabs rather than soft tabs, and that preference is probably responsible for much of the difference in indentation scheme. Unfortunately, HTML is terrible at representing hard tabs in &lt;PRE&gt; code with a custom width preference; they all come out looking like some idiot pressed space bar eight times. I could use JavaScript to remedy this, but for now, I like to directly copy and paste my working code from .HS files into &lt;PRE&gt; tags just in case.</div>

<div><br></div><div>If tabs are <i>not</i> the issue, then maybe I&#39;m not indenting far enough to the right for some tastes? Or maybe it&#39;s my tendency to put &quot;where&quot; on its own line, something a Perl obfuscater would detest. I dunno. If someone would suggest a more idiomatic indentation scheme for my code so that I know exactly what is different, I can take a look.</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In general, monotonically decreasing is not sufficient to prove you will hit<br>
a base case. For example, decreasing by 5 would still be monotonically<br>
decreasing, and could jump right over your base cases.<br>
(Not arguing that the code is incorrect, but rather than your explanation is<br>
a little misleading/incomplete.)<br></blockquote><div><br></div><div>Understood. Noted and reflected in the new version.</div><div><br></div><div>Incidentally, when will Nat be available in Haskell? The Fibonacci algorithm is designed to work only over natural numbers, and the best way to express this in the type system is with Nat. But this type doesn&#39;t seem available out-of-the-box for Haskell users. Unless I&#39;m using my Haskell Platform (GHC 7.0.3) is slightly outdated. Eh?</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Again, further confusion about what memoization really is.<br>
<br>
<br>
Under Records<br>
<br>
&quot;Functions are already defined by their data structures; they are already<br>
semantically bundled...&quot; doesn&#39;t seem to make sense.<br></blockquote><div> </div><div>Noted and reflected... I&#39;m trying to convey to an audience largely composed of Java and C++ fanatics how Haskell records are much better than OOP, how GADTs are more intuitive, robust, ... OOP doesn&#39;t even compare! That&#39;s what I&#39;m trying to get across in that bit. And it&#39;s hard to do this in just a few sentences, especially when the reader isn&#39;t even familiar with GADTs in the first place.</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
&quot;... acts on the specific constructor, blasting fools, murdering crowds...&quot;<br>
makes it sound like fireOn actually has side effects.<br>
</blockquote></div><br><div>A truly fair point. Would you like to contribute a monad for blowing up the moon?</div><div><br></div><div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">Another comment:</span></blockquote><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br></blockquote><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">&quot;As a declarative language, Haskell manipulates expressions, eventually reducing expressions to values.&quot;</span></blockquote>

<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br></blockquote>

<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Huh? In what sense do declarative languages manipulate expressions? Sounds like a classic syntax/semantics confusion, especially when interpreters and/or lazy evaluation (implementation issues, not language properties) are in the mix.</blockquote>

</div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Noted and reflected in the new version.</span></div>

<div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">I&#39;m trying to introduce the concept of declarative programming as opposed to imperative programming. Declarative programming according to <a href="http://en.wikipedia.org/wiki/Declarative_programming">Wikipedia</a>:</span></div>

<div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></span></div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<span style="background-color:rgb(255,255,255)"><font color="#222222" face="arial, sans-serif">is a programming paradigm that expresses the logic of a computation without describing its control flow.</font></span></blockquote>

<div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">I believe this is done in Haskell and other declarative languages by treating code as manipulable, reducible expressions, where imperative languages would use machine instructions.</span></div>

<div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">---</span></div>

<div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Now, besides the code and the description of the code, I know we&#39;re not English majors, but what do you think of the overall tone, pacing, etc.? Is it entertaining? Is it humorous? Is it boring? Is it offensive? Is it too brief or too laborious?</span></div>

<div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Thanks all for your suggestions.</span></div>