<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Monadically Speaking:  Benjamin's Adventures in PLT Wonderland</title>
	<atom:link href="http://dekudekuplex.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dekudekuplex.wordpress.com</link>
	<description>Benjamin's Adventures in Programming Language Theory Wonderland</description>
	<lastBuildDate>Fri, 06 Nov 2009 12:02:52 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='dekudekuplex.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/6b05e4474eaff1fc1fe4bac494d8960f?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Monadically Speaking:  Benjamin's Adventures in PLT Wonderland</title>
		<link>http://dekudekuplex.wordpress.com</link>
	</image>
			<item>
		<title>To Scheme, or Not to Scheme:  Scheming Schemers and Non-Scheming Schemers, or Keeping the Fun in Scheme</title>
		<link>http://dekudekuplex.wordpress.com/2009/10/23/to-scheme-or-not-to-scheme-scheming-schemers-and-non-scheming-schemers-or-keeping-the-fun-in-scheme/</link>
		<comments>http://dekudekuplex.wordpress.com/2009/10/23/to-scheme-or-not-to-scheme-scheming-schemers-and-non-scheming-schemers-or-keeping-the-fun-in-scheme/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 11:25:47 +0000</pubDate>
		<dc:creator>Benjamin L. Russell</dc:creator>
				<category><![CDATA[Continuations]]></category>
		<category><![CDATA[Multi-paradigm Programming]]></category>
		<category><![CDATA[Programming Language Theory]]></category>
		<category><![CDATA[Scheme]]></category>

		<guid isPermaLink="false">http://dekudekuplex.wordpress.com/?p=286</guid>
		<description><![CDATA[Do you use the Scheme programming language?  If so, do you program mainly in a serious mood to write applications, or in a crafty mood to have fun?  In other words, do you consider yourself a non-Scheming Schemer, or a Scheming Schemer?  I consider myself a Scheming Schemer:  I program in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=286&subd=dekudekuplex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Do you use the Scheme programming language?  If so, do you program mainly in a serious mood to write applications, or in a crafty mood to have fun?  In other words, do you consider yourself a non-Scheming Schemer, or a Scheming Schemer?  I consider myself a Scheming Schemer:  I program in Scheme mainly in a crafty mood just to have fun.  To quote Alan Perlis from the <a title="dedication in SICP" href="//mitpress.mit.edu/sicp/full-text/book/book-Z-H-3.html">dedication in SICP</a>:</p>
<blockquote><p>&#8220;I think that it&#8217;s extraordinarily important that we in computer science keep fun in computing. When it started out, it was an awful lot of fun. Of course, the paying customers got shafted every now and then, and after a while we began to take their complaints seriously. We began to feel as if we really were responsible for the successful, error-free perfect use of these machines. I don&#8217;t think we are. I think we&#8217;re responsible for stretching them, setting them off in new directions, and keeping fun in the house. I hope the field of computer science never loses its sense of fun. Above all, I hope we don&#8217;t become missionaries. Don&#8217;t feel as if you&#8217;re Bible salesmen. The world has too many of those already. What you know about computing other people will learn. Don&#8217;t feel as if the key to successful computing is only in your hands. What&#8217;s in your hands, I think and hope, is intelligence: the ability to see the machine as more than when you were first led up to it, that you can make it more.&#8221;</p>
<p>Alan J. Perlis (April 1, 1922-February 7, 1990)</p></blockquote>
<p>Nevertheless, as many of you probably know, some recent developments in the evolution of the Scheme programming language have reduced the influence of the language.  In particular, the <a title="R5RS vs. R6RS schism" href="http://lambda-the-ultimate.org/node/3582">R5RS vs. R6RS schism</a> and the <a title="replacement of the 6.001 course at MIT" href="http://www.mitadmissions.org/topics/learning/coursework/the_end_of_an_era_1.shtml">replacement of the 6.001 course at MIT</a>, based on Scheme, with a 6.01 course, based on Python, are two events that have created much controversy.</p>
<p>Concerned over such events, recently, I posted a thread, entitled <a title="&quot;Ideas for an SICP'?&quot;" href="http://groups.google.com/group/comp.lang.scheme/browse_thread/thread/5d5ffc21532446a9#">&#8220;Ideas for an SICP&#8217;?&#8221;</a> on the comp.lang.scheme USENET newsgroup, asking for suggestions for an alternative to SICP with a similar content, as follows:</p>
<blockquote><p>[W]ith Scheme replaced by Python at MIT, this special role of Scheme<br />
as the vehicle for teaching sophisticated students of computer science<br />
has been greatly diminished.  Arguments against SICP as being too<br />
difficult for an introductory textbook notwithstanding, the presence<br />
and usage of that textbook contributed greatly to the significance of<br />
Scheme as a tool in teaching introductory computer science.</p>
<p>It seems that SICP could use a replacement.  What is needed is an<br />
alternative textbook to use Scheme in a role that cannot be fulfilled<br />
by such languages as Python, in order to foster creativity and<br />
originality in programming for future freethinking hackers.  In<br />
addition, such an alternative textbook would need to be actively used<br />
by leading educational institutions of introductory computer science<br />
in raising a new generation of future Scheme hackers.</p>
<p>Does anybody have any suggestions for a plan that could lead to the<br />
birth and growth of such an alternative leading textbook?  Many<br />
programmers tend to be strongly influenced by the first textbook that<br />
they encounter in learning programming; whether that language is<br />
Scheme or Python could have great effect on the future influence of<br />
such languages.  The SICP phenomenon has been done once; why not give<br />
rise to a new SICP&#8217; phenonemon?</p></blockquote>
<p>There were several responses.  In particular, one user, Ray, <a title="responded" href="http://groups.google.com/group/comp.lang.scheme/msg/a95a2d13d16b12c0">responded</a> as follows:</p>
<blockquote><p>[N]obody who&#8217;s grown up with the web, and who thinks of<br />
computers as being primarily communications devices, will<br />
believe that that makes a language anything other than a<br />
crippled toy if you can&#8217;t interface with the hardware<br />
capabilities of the machine, enabling you to do something<br />
as &#8220;simple&#8221; as writing a web browser in it, managing network<br />
connections, handling Graphical UI elements, and rendering<br />
text and graphics on the screen.</p>
<p>[...]</p>
<p>Now, consider what Scheme&#8217;s got that Python doesn&#8217;t got.<br />
It comes down to syntactic abstraction and continuations.<br />
Courses based on SICP don&#8217;t use them, so MIT had nothing<br />
to lose by going to Python.</p></blockquote>
<p>Perhaps.  But has Scheme really lost the essence of its appeal?</p>
<p>I disagree.  Recently, I started reading a <a title="guide" href="http://karetta.jp/book-cover/gauche-hacks">guide</a> (albeit in Japanese, since I can read that language as well) by Shiro Kawai on the Gauche implementation of Scheme, and opened up a <a title="chapter" href="http://karetta.jp/book-node/gauche-hacks/007559">chapter</a> on <a title="continuations" href="http://en.wikipedia.org/wiki/Continuation">continuations</a>.  (For those of you who do not know, continuations are a control mechanism in Scheme which allows assignment of control flow to a variable, allowing a process to be &#8220;continued&#8221; (hence the name) from the point where the continuation was saved.)  Since I had not yet fully understood continuations, I found the chapter extremely interesting, and could not stop reading.  At one <a title="point" href="http://karetta.jp/book-node/gauche-hacks/007565">point</a>, I encountered the following procedure which used a continuation, written in <a title="continuation-passing style" href="http://en.wikipedia.org/wiki/Continuation-passing_style">continuation-passing style</a> (a.k.a. &#8220;CPS&#8221; style) (in which, rather than assigning the continuation directly to a variable, the continuation is explicitly passed as a parameter), to calculate the factorial function:</p>
<pre>(define (fact/cps n cont)
  (if (= n 0)
      (cont 1)
      (fact/cps (- n 1) (lambda (a) (cont (* n a))))))</pre>
<p>This procedure returns the same results as the following (much simpler) one (listed on the same page), which does not use a continuation:</p>
<pre>(define (fact n)
  (if (= n 0)
      1
      (* n (fact (- n 1)))))</pre>
<p>In particular, I started at the mysterious &#8220;(a)&#8221; variable in the following piece of code above, wondering what that variable represented:</p>
<pre>(fact/cps (- n 1) (lambda (a) (cont (* n a))))</pre>
<p>Suddenly, it dawned upon me:  The &#8220;(a)&#8221; variable stored the parameter that was passed to the continuation (&#8220;(lambda (a) (cont (* n a)))&#8221;), which, in turn, captured the control state of the procedure at that point of execution, which was, in turn, passed back as a parameter to the enclosing procedure!  In short, the continuation was a microcosm of the execution context of the procedure at that point in time, encapsulated in a lambda abstraction!</p>
<p>Here, &#8220;fact/cps&#8221; is the name of the procedure, which stands for &#8220;factorial in CPS (continuation-passing style) form.&#8221;</p>
<p>Suppose we call &#8220;fact/cps&#8221; in the most simple case:  a value of 0 for the first parameter, and a function that simply returns the parameter passed to it as a second parameter:</p>
<pre>(fact/cps 0 (lambda (a) a))</pre>
<p>Then, in &#8220;fact/cps&#8221;, &#8220;(= n 0)&#8221; is true in the if-statement, so &#8220;(cont 1)&#8221; is called, where &#8220;cont&#8221; is simply the second parameter of the enclosing &#8220;fact/cps&#8221; function, or &#8220;(lambda (a) a)&#8221; (the continuation), which returns the value of the parameter &#8220;a&#8221;, which is 1 in this case, so 1 is returned.</p>
<p>Let&#8217;s be a little bolder, and use a value of 1 for the first parameter:</p>
<pre>(fact/cps 1 (lambda (a) a))</pre>
<p>This time, &#8220;(= n 0)&#8221; is false in the if-statement, so the following recursive call is made (substituting 1 for n):</p>
<pre>(fact/cps (- 1 1) (lambda (a) (cont (* 1 a))))</pre>
<p>In the recursive call, (- 1 1) is substituted for the first parameter of &#8220;fact/cps&#8221;, and &#8220;(lambda (a) (cont (* 1 a))&#8221; is substituted for the second parameter of &#8220;fact/cps&#8221;.  This is the same as the following call (reducing the first parameter to a value):</p>
<pre>(fact/cps 0 (lambda (a) (cont (* 1 a))))</pre>
<p>However, since we had passed an identity function, &#8220;(lambda (a) a)&#8221; for &#8220;cont&#8221; in the enclosing function, this reduces to the following call (expanding &#8220;cont&#8221; to &#8220;(lambda (a) a)&#8221;):</p>
<pre>(fact/cps 0 (lambda (a) ((lambda (a) a) (* 1 a))))</pre>
<p>Here, the explicit continuation &#8220;(lambda (a) ((lambda (a) a) (* 1 a))))&#8221; first takes whatever is handed to it as the parameter &#8220;a&#8221;, and passes it to the inner function (lambda abstraction, actually, but we&#8217;ll dismiss that point here), so we reach &#8220;((lambda (a) a) (* 1 a))&#8221;.  But this is just the identity function on the inner &#8220;(* 1 a)&#8221;.  So this part just reduces to &#8220;&#8216;(* 1 a)&#8221;, which is the same as just &#8220;a&#8221;, which is whatever value is passed to this continuation, so this continuation is just the identity function.</p>
<p>So when &#8220;fact/cps&#8221; is recursively called with 0 for the first parameter n and this identity value continuation &#8220;(lambda (a) ((lambda (a) a) (* 1 a))))&#8221; for the second parameter cont, we first reach &#8220;(= n 0)&#8221; as the condition in the if-statement, which is true.  This leads to evaluating the following:</p>
<pre>(cont 1)</pre>
<p>But &#8220;(cont 1)&#8221; is just this identity continuation called with 1, so it just returns the parameter 1.  So, &#8220;(fact/cps 1 (lambda (a) a))&#8221; is just the value passed to it:</p>
<pre>1</pre>
<p>Of course, we didn&#8217;t need to pass the identity function &#8220;(lambda (a) a)&#8221; as the second parameter to &#8220;fact/cps&#8221;.  We could have formatted the output, for example, by passing a formatting function, instead (to borrow the syntax of Gauche Scheme):</p>
<pre>(lambda (a) (format #t "The factorial value is ~a." a))</pre>
<p>Then we could have invoked &#8220;fact/cps&#8221; with that formatting function for the function to be passed as the continuation, as follows:</p>
<pre>(fact/cps 3 (lambda (a) (format #t "The factorial value is ~a." a)))</pre>
<p>This would have returned the following:</p>
<pre>The factorial value is 6.#&lt;undef&gt;</pre>
<p>Alternatively, we could have chosen to multiple whatever was returned by 2, just to screw up the function, as follows:</p>
<pre>(fact/cps 3 (lambda (a) (* 2 a)))</pre>
<p>This would have returned the following:</p>
<pre>12</pre>
<p>Hey, why not combine the two functions, and get Scheme to say something funny?</p>
<pre>(fact/cps 3 (lambda (a) (format #t "I do solemnly swear that the factorial value is ~a." (* 2 a))))</pre>
<p>Scheme then would have returned the following:</p>
<pre>I do solemnly swear that the factorial value is 12.</pre>
<p>Despite (or maybe because of?) all this exploratory monkey-business, in the &#8220;Aha!&#8221; moment described above, I felt an ecstasy of enlightenment that I do not often experience elsewhere (er, elsewhen, rather).</p>
<p>Such &#8220;Aha!&#8221; moments are crucial to appreciating the fun in computer science.  They are commonly found whenever a deeper level of understanding is achieved by contemplating something which is not obvious at first. I have noticed that they are found more easily in Scheme than in some other programming languages, because of the flexibility that the language allows in even esoteric expressions.</p>
<p>In order to enjoy programming, one must appreciate the fun in programming, and it is difficult to appreciate this factor without experiencing an &#8220;Aha!&#8221; moment.  The deeper the understanding, the more intense the exhilaration associated.  Continuations and syntactic abstraction, in particular, are very abstruse (some may even say &#8220;arcane&#8221;) topics, especially when first encountered, and can require relatively deep understanding.  Hence, by providing opportunities to learn such concepts, Scheme can provide an ideal opportunity to experience the fun of programming.  Thus, the continued need for Scheme.</p>
<p>Not all books that use Scheme adopt this approach.  An alternative approach is to structure the curriculum so that the learning becomes a linear process, rather than a series of leaps, so that all the parts fit together neatly like solving a jigsaw puzzle, rather than like climbing a mountain.</p>
<p>Not to be critical of this approach, but not everybody prefers it.  In one critique, José Antonio Ortega Ruiz, in his blog, &#8220;<a title="A Scheme bookshelf « programming musings" href="http://programming-musings.org/2007/01/31/a-scheme-bookshelf/">A Scheme bookshelf « programming musings</a>,&#8221; contrasts one well-known textbook that uses this alternative approach, <a title="How to Design Programs" href="http://htdp.org/"><em>How to Design Programs</em></a> (a.k.a. &#8220;HtDP&#8221;), with SICP, as follows:</p>
<blockquote><p>The most cited alternative to SICP is <a href="http://htdp.org/">How to Design Programs</a> by Felleisen, Findler, Flatt and Krishnamurthi. Its authors have even published a rationale, <a href="http://www.cs.brown.edu/%7Esk/Publications/Papers/Published/fffk-htdp-vs-sicp-journal/paper.pdf">The Structure and Interpretation of the Computer Science Curriculum</a>, on why they think SICP is not well suited to teaching programming and how their book tries to fix the problems they’ve observed. I won’t try to argue against such eminent schemers, but, frankly, my feeling is that HtDP is a far, far cry from SICP. HtDP almost made me yawn, and there’s no magic to be seen.</p></blockquote>
<p>Ortega-Ruiz is somewhat harsh in his critique of HtDP.  After all, according to the authors of the paper explaining the rationale behind the book, <a href="http://www.cs.brown.edu/%7Esk/Publications/Papers/Published/fffk-htdp-vs-sicp-journal/paper.pdf">The Structure and Interpretation of the Computer Science Curriculum</a>, HtDP was created in the first place to rectify two major perceived problems with SICP (page 9 of the paper):</p>
<blockquote><p>&#8230; SICP doesn’t state how to program and how to manage the design<br />
of a program. It leaves these things implicit and implies that students can discover a<br />
discipline of design and programming on their own. The course presents the various<br />
uses and roles of programming ideas with a series of examples. Some exercises then<br />
ask students to modify this code basis, requiring students to read and study code;<br />
others ask them to solve similar problems, which means they have to study the<br />
construction and to change it to the best of their abilities. In short, SICP students<br />
learn by copying and modifying code, which is barely an improvement over typical<br />
programming text books.</p>
<p>SICP’s second major problem concerns its selection of examples and exercises. All<br />
of these use complex domain knowledge&#8230;.</p>
<p>While these topics are interesting to students who use computing in electrical<br />
engineering and to those who already have significant experience of programming<br />
and computing, they assume too much understanding from students who haven’t<br />
understood programming yet and they assume too much domain knowledge from<br />
any beginning student who needs to acquire program design skills. On the average,<br />
beginners are not interested in mathematics and electrical engineering, and they do<br />
not have ready access to the domain knowledge necessary for solving the domain<br />
problems. As a result, SICP students must spend a considerable effort on the do-<br />
main knowledge and often end up confusing domain knowledge and program design<br />
knowledge. They may even come to the conclusion that programming is a shallow<br />
activity and that what truly matters is an understanding of domain knowledge.</p></blockquote>
<p>While these are all valid points, Ortega-Ruiz&#8217;s last clause, &#8220;there&#8217;s no magic to be seen,&#8221; actually describes the key conflict here.  What exactly is this &#8220;magic?&#8221;  To be experimentally borderline facetious, according to Arthur C. Clarke,</p>
<blockquote><p>Any sufficiently advanced technology is indistinguishable from magic.</p>
<dl>
<dd><strong><a href="http://www.quotationspage.com/quotes/Arthur_C._Clarke/">Arthur C. Clarke</a></strong>, <em>&#8220;Profiles of The Future&#8221;, 1961 (Clarke&#8217;s third law)</em><br />
<em>English physicist &amp; science fiction author  (1917 &#8211;  )</em></dd>
</dl>
</blockquote>
<p>So maybe we&#8217;re actually referring to &#8220;any sufficiently advanced technology.&#8221;  What do we mean by &#8220;sufficiently advanced?&#8221;  I would suggest (to use a recursive definition), &#8220;sufficiently advanced to the point that deep understanding unachievable superficially is required to understand the material.&#8221;</p>
<p>Whether or not this &#8220;magic&#8221; is to be used in pedagogy actually relates to the fundamental design philosophy behind HtDP, as opposed to that behind SICP.  To quote the above-referenced paper explaining the rationale behind HtDP, &#8220;<a href="http://www.cs.brown.edu/%7Esk/Publications/Papers/Published/fffk-htdp-vs-sicp-journal/paper.pdf">The Structure and Interpretation of the Computer Science Curriculum</a>,&#8221; as follows (page 11):</p>
<blockquote><p>The recipes also introduce a new distinction into program design: structural ver-<br />
sus generative recursion. The structural design recipes in the first half of the book<br />
match the structure of a function to the structure of a data definition. When the<br />
data definition happens to be self-referential, the function is recursive; when there<br />
is a group of definitions with mutual cross-references, there is a group of function<br />
definitions with mutual references among the functions. In contrast, generative re-<br />
cursion concerns the generation of new problem data in the middle of the problem<br />
solving process and the re-use of the problem solving method.</p>
<p>Compare <em>insort</em> and <em>kwik</em>, two standard sort functions:</p>
<pre>;; (listof X) -&gt; (listof X)
(define (insort l )
  (cond
    [(empty? l ) empty]
    [else
      (place
        (first l )
        (insort (rest l )))]))

;; (listof X) -&gt; (listof X)
(define (kwik l )
  (cond
    [(empty? l ) empty]
    [else
      (append (kwik (larger (first l ) l ))
                  (first l )
                  (kwik (smaller (first l ) l )))]))</pre>
<p>The first function, insort , recurs on a structural portion of the given datum, namely,<br />
(rest l ). The second function, kwik, recurs on data that are generated by some other<br />
functions. To design a structurally recursive function is usually a straightforward<br />
process. To design a generative recursive function, however, almost always requires<br />
some ad hoc insight into the process. Often this insight is derived from some mathe-<br />
matical idea. In addition, while structurally recursive functions naturally terminate<br />
for all inputs, a generative recursive function may diverge. htdp therefore suggests<br />
that students add a discussion about termination to the definition of generative<br />
recursive functions.</p></blockquote>
<p>HtDP takes pains to remove the requirement for this &#8220;ad hoc insight&#8221; into the problem-solving process.  The authors of the book then make the following claim (same page):</p>
<blockquote><p>Distinguishing the two forms of recursion and focusing on the structural case<br />
makes our approach scalable to the object-oriented (OO) world.</p></blockquote>
<p>That may be so, but that contrasts sharply with the spirit of the original quotation by Alan Perlis above:</p>
<blockquote><p>Of course, the paying customers got shafted every now and then, and after a while we began to take their complaints seriously. We began to feel as if we really were responsible for the successful, error-free perfect use of these machines. I don&#8217;t think we are. I think we&#8217;re responsible for stretching them, setting them off in new directions, and keeping fun in the house.</p></blockquote>
<p>So we have two sharply contrasting approaches:  One to use Scheme for fun, and the other to use Scheme for scalability.  Again, this basically is a matter of taste.</p>
<p>In his above-mentioned <a title="post" href="http://groups.google.com/group/comp.lang.scheme/msg/a95a2d13d16b12c0">post</a> in the above-mentioned thread, Ray contrasted the advantages of Scheme vs. Python as follows:</p>
<blockquote><p><span style="font-family:Courier,Monospaced;">[S]cheme still has no standard means of managing network connections<br />
or rendering anything on the screen.  Python has these things.<br />
</span></p>
<p><span style="font-family:Courier,Monospaced;">Now, consider what Scheme&#8217;s got that Python doesn&#8217;t got.<br />
It comes down to syntactic abstraction and continuations.<br />
Courses based on SICP don&#8217;t use them, so MIT had nothing<br />
to lose by going to Python.<br />
</span></p>
<p><span style="font-family:Courier,Monospaced;">SICP doesn&#8217;t use syntactic abstraction.  In the first<br />
edition, this was because Scheme didn&#8217;t have them yet.<br />
In the current edition &#8230;. well, here&#8217;s the footnote<br />
about macros from the current edition, page 373:<br />
</span></p>
<p><span style="font-family:Courier,Monospaced;"> Practical Lisp systems provide a mechanism that<br />
allows users to add new derived expressions and<br />
specify their implementation as syntactic<br />
transformations without modifying the evaluator.<br />
Such a user-defined transformation is called a<br />
/macro/. Although it is easy to add an elementary<br />
mechanism for defining macros, the resulting<br />
language has subtle name-conflict problems. There<br />
has been much research on mechnaisms for macro<br />
definitions that do not cause these  difficulties.<br />
See, for example, Kohlbecker 1986, Clinger and<br />
Rees 1991, and Hanson 1991.<br />
</span></p>
<p><span style="font-family:Courier,Monospaced;">(Aside: &#8220;practical&#8221; lisp systems have them; the dialect<br />
covered in the book does not.  Students can and do draw<br />
the obvious conclusion&#8230;.) </span></p></blockquote>
<p>Granted, specific implementations do have these functions.  But there is no single main implementation of Scheme that everybody uses, and the libraries that implement these functions are not necessarily portable across implementations.  Therefore, Scheme as a language (as opposed to a specific implementation) does not have these functions.</p>
<p>But is that necessarily bad?  I don&#8217;t think so.  I think that the whole point of Scheme, as a language, is, to quote Alan Perlis above, that we are &#8220;[not] responsible for the successful, error-free perfect use of these machines, [but] for stretching them, setting them off in new directions, and keeping fun in the house.&#8221;</p>
<p>To sum, when I first approached SICP, I found it too challenging to digest.  I had to quit reading it repeatedly, and then return to it later, and I still have read only a portion of the book.  But I became entranced with the magic of computer science as demonstrated by such creatures as tail recursion in Scheme in SICP.  And it was precisely this magic that kept me returning to computer science in general, and to Scheme in particular.</p>
<p>On the other hand, books such as HtDP are very comforting and reassuring.  While SICP sometimes makes me wonder why I am such an idiot, HtDP makes me feel as if I am no longer an idiot.  I no longer need to think for hours and hours during my sleep about how to overcome a particular problem.  Books such as HtDP make the material very straightforward.  However, by doing so, they also remove all the magic, and break the spell.</p>
<p>I feel that an intermediate approach is better.  The magic is necessary, but the sorcery in SICP can be too much at first.  However, the jigsaw-puzzle approach of HtDP seems too straightforward.  There is not enough exploration to maintain interest after a certain level of reader sophistication.  Paradoxically, although I can read HtDP much, much faster than SICP, I also fall asleep reading it just as much faster, and actually haven&#8217;t read so far in it.  A gentler approach than that of SICP, which still offers more exploration than HtDP, would be a better compromise.</p>
<p>Also, I feel that the greatest strength of Scheme lies in its flexibility for exploratory programming.  Scheme shares one quality that is also shared by such addictive games as Tetris:  It is relatively simple to learn, yet extremely difficult to master.  Writing simple procedures to calculate such functions as the factorial function or the Fibonacci sequence is deceptively simple at first.  But when the student ventures into such deeper areas as tail recursion, continuations, and syntactic abstractions, the procedures can become tantalizingly complex.</p>
<p>To conclude, shouldn&#8217;t Scheme really be a language for scheming programmers to figure out mainly how to have fun?  I like to be a Scheming Schemer, always scheming plots for stretching the lambda abstractions to set them off in new directions, mainly just to have fun.  Are you a Scheming Schemer?</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dekudekuplex.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dekudekuplex.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dekudekuplex.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dekudekuplex.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dekudekuplex.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dekudekuplex.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dekudekuplex.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dekudekuplex.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dekudekuplex.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dekudekuplex.wordpress.com/286/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=286&subd=dekudekuplex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dekudekuplex.wordpress.com/2009/10/23/to-scheme-or-not-to-scheme-scheming-schemers-and-non-scheming-schemers-or-keeping-the-fun-in-scheme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a5af05af2cafbe739659871b86a07820?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Benjamin L. Russell</media:title>
		</media:content>
	</item>
		<item>
		<title>Conquering the Fear of Reading Research Papers: Computer Science Research Papers for Non-Computer Scientists</title>
		<link>http://dekudekuplex.wordpress.com/2009/08/26/conquering-the-fear-of-reading-research-papers-computer-science-research-papers-for-non-computer-scientists/</link>
		<comments>http://dekudekuplex.wordpress.com/2009/08/26/conquering-the-fear-of-reading-research-papers-computer-science-research-papers-for-non-computer-scientists/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 10:00:11 +0000</pubDate>
		<dc:creator>Benjamin L. Russell</dc:creator>
				<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Multi-paradigm Programming]]></category>
		<category><![CDATA[Object-oriented Programming]]></category>
		<category><![CDATA[Programming Language Theory]]></category>
		<category><![CDATA[Scheme]]></category>
		<category><![CDATA[Simula]]></category>
		<category><![CDATA[Smalltalk]]></category>

		<guid isPermaLink="false">http://dekudekuplex.wordpress.com/?p=257</guid>
		<description><![CDATA[Any non-mathematician, non-computer scientist layperson who has approached programming languages originally spawned in academia, such as Haskell or Scheme, has no doubt been intimidated by the academic rigor and density of many research papers on such subjects.  Even such papers labeled &#8220;gentle,&#8221; as &#8220;A Gentle Introduction to Haskell&#8221; [1], can turn out to be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=257&subd=dekudekuplex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Any non-mathematician, non-computer scientist layperson who has approached programming languages originally spawned in academia, such as <a href="http://www.haskell.org/">Haskell</a> or <a href="http://en.wikipedia.org/wiki/Scheme_(programming_language)">Scheme</a>, has no doubt been intimidated by the academic rigor and density of many research papers on such subjects.  Even such papers labeled &#8220;gentle,&#8221; as &#8220;A Gentle Introduction to Haskell&#8221; <a href="http://www.haskell.org/tutorial/">[1]</a>, can turn out to be less &#8220;gentle&#8221; than expected for those not familiar with the field.</p>
<p>Although I myself do have a background in computer science, as a patent translator, and not a mathematician, computer scientist, or programmer, I tend to approach such papers as more of an amateur programming language theory hobbiest and writer.  Having tried to read a number of such papers, I have discovered that although many of them can be difficult to approach, some tend to be more approachable than others.</p>
<p>In particular, most recently, I was rather surprised to encounter a rather lengthy research paper on the history of one such programming language, <a href="http://en.wikipedia.org/wiki/Simula">Simula</a>, which, although detailed, nevertheless turned out to be surprising approachable in not assuming advanced technical knowledge of the field (although it still required great attention to detail):  &#8220;Compiling SIMULA: A Historical Study of Technological Genesis&#8221; <a href="http://www.idi.ntnu.no/grupper/su/publ/simula/holmevik-simula-ieeeannals94.pdf">[2]</a>.</p>
<p>This paper, rather than focusing solely on the technical development of the language, conducts a sociotechnical analysis of the broader historical background surrounding the Simula project.  There are no formulas or even code snippets; instead, even though the paper is a research paper published in the IEEE Annals of the History of Computing, it is written as a history paper which just happens to be about the historical background of a programming language.  Even more surprising, according to the endnote of the paper, the author, Jan Rune Holmevik, at the time of publication, was a graduate student in history at the University of Trondheim, Norway, and the paper itself &#8220;was written as part of [his] dissertation thesis in history <em>Hovudfag</em> [3] at the University of Trondheim&#8221; (page 36).  In other words, this is a detailed research paper on a programming language, published in an academic journal, which does not assume any ability to program.</p>
<p>Until reading this paper, I had assumed that rigorous research papers on computer science published in academic journals were either written by mathematicians or computer scientists, or at least assumed a background in either mathematics or computer science to read.  While this paper is definitely thoroughly researched, documented, and described, and approaches its topic in excruciating detail, it does not assume any background in either mathematics or computer science.</p>
<p>In other words, one need not necessarily be a mathematician or a computer scientist to write, much less read, a research paper on computer science; in fact, there are even some very thorough and detailed research papers on computer science published in academic journals which do not assume any background in either mathematics or computer science, such as this paper.</p>
<p>This discovery came as a revelation.</p>
<p>If it is possible to write a research paper without a background in either mathematics or computer science, then it must definitely also be possible to read at least some such papers.  Furthermore, this is most likely not the only such research paper.</p>
<p>In fact, so far, I have encountered a number of computer science research papers which similarly require no or very little background in mathematics or computer science.  Here is a list of some other interesting, yet approachable, research papers which (1) are either devoid of, or substantially devoid of, mathematical formulae; (2) are either devoid of, or substantially devoid of, code snippets; and (3) are either devoid of, or substantially devoid of, technical content assuming a background in mathematics or computer science:</p>
<blockquote><p>i) &#8220;The Structure and Interpretation of the Computer Science Curriculum&#8221; <a href="http://www.cs.brown.edu/~sk/Publications/Papers/Published/fffk-htdp-vs-sicp-journal/">[4]</a>.  By Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, Shriram Krishnamurthi.<br />
Published in the <em>Journal of Functional Programming</em> in 2004, this paper discusses the motivation and design rationale for the book <em>How to Design Programs</em> <a href="http://www.htdp.org/">[5]</a> by comparision and contrast with the book <em>Structure and Interpretation of Computer Programs</em> <a href="http://mitpress.mit.edu/sicp/full-text/book/book.html">[6]</a>.</p>
<p>ii) &#8220;Haskell: Batteries Included&#8221; <a href="http://www.cse.unsw.edu.au/~dons/papers/haskell31-coutts.pdf">[7]</a>. By Duncan Coutts, Isaac Potoczny-Jones, and Don Stewart. Published in <em>Proceedings of the first ACM SIGPLAN symposium on Haskell (2008)</em>.<br />
This paper outlines the motivation for and structure of the Haskell Platform, a &#8220;Haskell for the masses&#8221; versioned packaging system of Haskell and included libraries.  Although this paper does not specifically assume familiarity with mathematics or computer science, it does make use of such technical terminology as &#8220;libraries,&#8221; &#8220;packages,&#8221; &#8220;source code,&#8221; and &#8220;package description file.&#8221;</p>
<p>iii) &#8220;Teaching Programming Languages in a Post-Linnaean Age&#8221; <a href="http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-teach-pl-post-linnaean/">[8]</a>. By Shriram Krishnamurthi. Published in <em>First SIGPLAN Workshop on Undergraduate Programming Language Curricula</em> in 2008.<br />
This paper claims that programming languages should be viewed as aggregations of features, rather than languages defined by taxonomies, and asserts that the term &#8220;paradigm&#8221; is ill-defined and should play no role in classifying programming languages.  The book also addresses the issue of the split between textbooks that are &#8220;rich in mathematical rigor but low on accessibility, and those high on accessibility but lacking rigor (and, often, even wrong),&#8221; and offers an alternative.</p>
<p>iv) &#8220;The Early History of Smalltalk&#8221; <a href="http://gagne.homedns.org/~tgagne/contrib/EarlyHistoryST.html">[9]</a>. By Alan C. Kay. Published in <em>History of Programming Languages: The second ACM SIGPLAN conference on History of programming languages</em> in 1993.<br />
This paper describes the historical background behind the evolution of <a href="http://en.wikipedia.org/wiki/Smalltalk">Smalltalk</a>, a pure object-oriented language.  It also, in part, describes the visit of Steve Jobs, Jeff Raskin, and others of then Apple, Inc. to the Xerox PARC laboratory, which led to the subsequent development of the Macintosh user interface, based on the Smalltalk user interface.</p>
<p>v) &#8220;Design Principles Behind Smalltalk&#8221; <a href="http://www.fit.vutbr.cz/study/courses/OMP/public/software/sqcdrom2/Documents/DesignPrinciples/DesignPrinciples.html">[10]</a>. By Daniel H. H. Ingalls. Published in BYTE Magazine, August 1981.<br />
This paper is a non-technical exposition of the design principles behind the Smalltalk-80 programming system.  Illustrated with descriptive figures, the paper focuses not just on the programming language issues behind Smalltalk as a language of description, but also the user interface issues behind Smalltalk as a language of interaction.  In particular, the paper describes how the research, in two- to four-year cycles, has paralleled the scientific method in repeatedly making an observation, formulating a theory, and making a prediction that can be tested, and summarizes key concepts as one- to two-sentence nutshell statements.</p></blockquote>
<p>Lastly (but not leastly), the following paper, although containing a significant number of code snippets and assuming some background in computer science, is sufficiently interesting to be worthy of special mention; the first few sections of it can be safely read by a reader unfamiliar with the subject matter:</p>
<blockquote><p>vi) &#8220;A History of Haskell: Being Lazy With Class&#8221; <a href="http://research.microsoft.com/en-us/um/people/simonpj/papers/history-of-haskell/history.pdf">[11]</a>. By Paul Hudak, John Hughes, Simon Peyton Jones, and Philip Wadler. Published in <em>The Third ACM SIGPLAN History of Programming Languages Conference (HOPL-III)</em> in 2007.<br />
This paper provides a very interesting description of the motivation and historical background of the functional programming language Haskell.  In particular, the paper describes the influence of a precursor to Haskell, <a href="http://en.wikipedia.org/wiki/Miranda_(programming_language)">Miranda</a> (pages 3 to 4); mentions how Gerry Sussman and Guy L. Steele briefly considered the idea of introducing lazy evaluation in Scheme (page 3); provides a timeline of the development of Haskell (page 7), and then proceeds on to describe the syntax and semantics (pages 11 to 28), implementations and tools (pages 28 to 35), and applications and impact (pages 35 to 46).  I sometimes return back to this paper when I feel frustrated with the dryness of many other papers on Haskell, since this is one of the few papers on the language which conveys a sense of the excitement surrounding the birth and early development of the language; many other papers on Haskell tend to focus solely on technical issues, without discussing the role of human beings in the context.</p>
<p>As pointed out in Holmevik <a href="http://www.idi.ntnu.no/grupper/su/publ/simula/holmevik-simula-ieeeannals94.pdf">[2]</a>, programming languages do not &#8220;evolve in a technical or scientific vacuum&#8221; (page 35).  This point is often ignored in many other papers about Haskell; luckily, it is dealt with in depth in this paper.</p></blockquote>
<p>In my experience, becoming accustomed to reading research papers is a gradual, rather than instantaneous, process:  After reading a number of such papers, one tends to become used to reading them; to recognize that failure to understand the content is not necessarily the fault of the reader, but often that of a wolly exposition that either fails to describe prerequisites to the content, or does not describe them adequately; and that the best research papers are not necessarily those that describe the most difficult content, but those that offer the most readily understandable exposition of the material to the intended target audience.</p>
<p>One must understand that many research papers are not necessarily written to be easy to read, but to fulfill a specific need, such as a part of a requirement for a degree, and are hence qualitatively different from most textbooks, which tend to be written so as to be easy to understand for a broader audience.  Hence, it is actually quite normal for a research paper of mediocre quality to be written in such a way as to expect the reader to fill in the prequisite content, which may be assumed but not stated.  (Of course, the best research papers tend to fill in any prerequisite content.)</p>
<p>Often, the best researchers are not the best writers; many of them cannot understand why a topic which is of trivial difficulty to them can possibly be of non-trivial difficulty for another reader.  A reader aware of this fact can often approach research papers with a better plan for mastering the content therein.</p>
<p>Lastly, if I might add a personal expectation, I tend to enjoy reading papers that acknowledge that a programming language is an artifact resulting from a complex interplay of many different human desires, needs, and expectations surrounding its birth, and does not develop in a social vacuum.  Computers do not design programming languages; people do.  Therefore, discussing a programming language as if it were merely a logical extension of prior developments in syntax and semantics ignores a significant factor in its evolution.  I have found that the best research papers tend to be those that, while providing a rigorous treatment of the subject material, do not assume any prerequite material not normally possessed by the intended target audience; acknowledge that some readers may not be as intelligent as the author and may find certain points that seem trivial to the author to be non-trivial; provide sufficient elucidation to cope accordingly; and discuss the human issues surrounding the design and evolution of the language.</p>
<p>[1] Hudak, Paul. &#8220;A Gentle Introduction to Haskell, Version 98.&#8221; New York, NY: <em>ACM SIGPLAN Notices</em> 27:5 (1992): 1-52. &lt;<a href="http://portal.acm.org/ft_gateway.cfm?id=130698&amp;type=pdf&amp;coll=GUIDE&amp;dl=GUIDE&amp;CFID=50053868&amp;CFTOKEN=12610081">http://portal.acm.org/ft_gateway.cfm?id=130698&amp;type=pdf&amp;coll=GUIDE&amp;dl=GUIDE&amp;CFID=50053868&amp;CFTOKEN=12610081</a>&gt;. An updated, free 1998 version is also available at &lt;<a href="http://www.haskell.org/tutorial/">http://www.haskell.org/tutorial/</a>&gt;.</p>
<p>[2] Holmevik, Jan Rune. &#8220;Compiling SIMULA: A Historical Study of Technological Genesis.&#8221; Washington, D.C.: <em>Annals of the History of Computing</em> 16:4 (1994): 25-36. &lt;<a href="http://www.idi.ntnu.no/grupper/su/publ/simula/holmevik-simula-ieeeannals94.pdf">http://www.idi.ntnu.no/grupper/su/publ/simula/holmevik-simula-ieeeannals94.pdf</a>&gt;.</p>
<p>[3] Regarding the term &#8220;<em>Hovudfag,</em>&#8221; Holmevik writes (page 36, footnote), &#8220;<em>Hovudfag</em> may be regarded as the Norwegian equivalent to a master&#8217;s degree, although it carries considerably more workload and normally takes two to three years to complete.&#8221;</p>
<p>[4] Felleisen, Matthias, Robert Bruce Findler, Matthew Flatt, and Shriram Krishnamurthi. &#8220;The Structure and Interpretation of the Computer Science Curriculum.&#8221; Cambridge: <em>Journal of Functional Programming</em> 14:4 (2004): 365-378. &lt;<a href="http://www.cs.brown.edu/~sk/Publications/Papers/Published/fffk-htdp-vs-sicp-journal/">http://www.cs.brown.edu/~sk/Publications/Papers/Published/fffk-htdp-vs-sicp-journal/</a>&gt;.</p>
<p>[5] Felleisen, Matthias, Robert Bruce Findler, Matthew Flatt, and Shriram Krishnamurthi. <em>How to Design Programs</em>. Cambridge, MA: The MIT Press, 2003. &lt;<a href="http://www.htdp.org/">http://www.htdp.org/</a>&gt;.</p>
<p>[6] Abelson, Harold and Gerald Jay Sussman with Julie Sussman. <em>Structure and Interpretation of Computer Programs, Second Edition</em>. Cambridge, MA: The MIT Press and New York: McGraw-Hill, 1996. &lt;<a href="http://mitpress.mit.edu/sicp/full-text/book/book.html">http://mitpress.mit.edu/sicp/full-text/book/book.html</a>&gt;.</p>
<p>[7] Coutts, Duncan, Isaac Potoczny-Jones, and Don Stewart. &#8220;Haskell: Batteries Included.&#8221; Victoria, BC, Canada: <em>Proceedings of the first ACM SIGPLAN symposium on Haskell</em> (2008): 125-126.&lt;<a href="http://www.cse.unsw.edu.au/~dons/papers/haskell31-coutts.pdf">http://www.cse.unsw.edu.au/~dons/papers/haskell31-coutts.pdf</a>&gt;.</p>
<p>[8] Krishnamurthi, Shriram. &#8220;Teaching Programming Languages in a Post-Linnaean Age.&#8221; Cambridge, MA: <em>First SIGPLAN Workshop on Undergraduate Programming Language Curricula</em> (2008): 81-83. &lt;<a href="http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-teach-pl-post-linnaean/">http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-teach-pl-post-linnaean/</a>&gt;.</p>
<p>[9] Kay, Alan C. “The Early History of Smalltalk.” Cambridge, Massachusetts: <em>History of Programming Languages: The second ACM SIGPLAN conference on History of programming languages</em> (1993): 69-95. &lt;<a href="http://portal.acm.org/citation.cfm?id=154766.155364&amp;coll=GUIDE&amp;dl=GUIDE&amp;CFID=45415434&amp;CFTOKEN=84716013">http://portal.acm.org/citation.cfm?id=154766.155364&amp;coll=GUIDE&amp;dl=GUIDE&amp;CFID=45415434&amp;CFTOKEN=84716013</a>&gt;. Also available at &lt;<a href="http://gagne.homedns.org/~tgagne/contrib/EarlyHistoryST.html">http://gagne.homedns.org/~tgagne/contrib/EarlyHistoryST.html</a>&gt;.</p>
<p>[10] Ingalls, Daniel H. H. &#8220;Design Principles Behind Smalltalk.&#8221; <em>BYTE Magazine</em>, August 1981. &lt;<a href="http://www.fit.vutbr.cz/study/courses/OMP/public/software/sqcdrom2/Documents/DesignPrinciples/DesignPrinciples.html">http://www.fit.vutbr.cz/study/courses/OMP/public/software/sqcdrom2/Documents/DesignPrinciples/DesignPrinciples.html</a>&gt;.</p>
<p>[11] Hudak, Paul, John Hughes, Simon Peyton Jones, and Philip Wadler. &#8220;A History of Haskell: Being Lazy With Class.&#8221; San Diego, CA: <em>The Third ACM SIGPLAN History of Programming Languages Conference (HOPL-III)</em> (2007): 12-1 &#8211; 12-55, 2007. &lt;<a href="http://research.microsoft.com/en-us/um/people/simonpj/papers/history-of-haskell/history.pdf">http://research.microsoft.com/en-us/um/people/simonpj/papers/history-of-haskell/history.pdf</a>&gt;.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dekudekuplex.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dekudekuplex.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dekudekuplex.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dekudekuplex.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dekudekuplex.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dekudekuplex.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dekudekuplex.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dekudekuplex.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dekudekuplex.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dekudekuplex.wordpress.com/257/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=257&subd=dekudekuplex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dekudekuplex.wordpress.com/2009/08/26/conquering-the-fear-of-reading-research-papers-computer-science-research-papers-for-non-computer-scientists/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a5af05af2cafbe739659871b86a07820?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Benjamin L. Russell</media:title>
		</media:content>
	</item>
		<item>
		<title>Paradigm Shift: Back to the Past, and No Small Talk About Smalltalk</title>
		<link>http://dekudekuplex.wordpress.com/2009/08/25/paradigm-shift-back-to-the-past-and-no-small-talk-about-smalltalk/</link>
		<comments>http://dekudekuplex.wordpress.com/2009/08/25/paradigm-shift-back-to-the-past-and-no-small-talk-about-smalltalk/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 10:01:48 +0000</pubDate>
		<dc:creator>Benjamin L. Russell</dc:creator>
				<category><![CDATA[Object-oriented Programming]]></category>
		<category><![CDATA[Programming Language Theory]]></category>
		<category><![CDATA[Smalltalk]]></category>

		<guid isPermaLink="false">http://dekudekuplex.wordpress.com/?p=227</guid>
		<description><![CDATA[Those who have been reading my posts may have noticed this trend, but there has been a decided shift in the nature of my posts starting on June 18, 2009.
Specifically, prior to this date, the majority of my posts focused on Haskell, Scheme, and category theory, with a focus on purely functional programming.  While [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=227&subd=dekudekuplex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Those who have been reading my posts may have noticed this trend, but there has been a decided shift in the nature of my posts starting on June 18, 2009.</p>
<p>Specifically, prior to this date, the majority of my posts focused on <a href="http://www.haskell.org/">Haskell</a>, <a href="http://en.wikipedia.org/wiki/Scheme_(programming_language)">Scheme</a>, and <a href="http://en.wikipedia.org/wiki/Category_theory">category theory</a>, with a focus on purely <a href="http://en.wikipedia.org/wiki/Functional_programming">functional programming</a>.  While I am still interested in purely functional programming, one of my other major interests is in creating a three-dimensional <a href="http://en.wikipedia.org/wiki/Virtual_world">virtual world</a> with some innovative functionality (I have something specific in mind).</p>
<p>At first, I was intent on finding a way to create such a world using a purely functional programming language.  However, most purely functional programming languages do not have enough libraries to enable easy creation of such a world.  Furthermore, in order to create such a world, most purely functional programming languages would require a rather sophisticated knowledge of <a href="http://en.wikipedia.org/wiki/Linear_algebra">linear algebra</a>, which is one area of mathematics that my visiting <a href="http://en.wikipedia.org/wiki/Discrete_mathematics">discrete mathematics</a> professor in college did not adequately cover, and which I have never had enough time to study fully on my own; by contrast, my favorite areas of mathematics are all related to <a href="http://en.wikipedia.org/wiki/Set_theory">set theory</a>, <a href="http://en.wikipedia.org/wiki/Recursive_function_theory">recursive function theory (a.k.a. &#8220;computability theory&#8221;)</a>, and <a href="http://en.wikipedia.org/wiki/Philosophical_logic">philosophical logic</a>.</p>
<p>Therefore, I began searching for a programming language which would enable feasible writing of a three-dimensional virtual world without requiring explicit knowledge of linear algebra.  Furthermore, since I was interested in <a href="http://en.wikipedia.org/wiki/Programming_language_theory">programming language theory</a>, I wanted a programming language that was at least based on a general-purpose programming language, as opposed to a <a href="http://en.wikipedia.org/wiki/Domain-specific_language">domain-specific language</a>.</p>
<p>After an intermittent search that lasted several months, I eventually came across a tool called &#8220;<a href="http://www.duke.edu/~julian/Cobalt/Home.html">Cobalt</a>,&#8221; based on <a href="http://www.opencroquet.org/index.php/Main_Page">Croquet</a>, further based on <a href="http://www.squeak.org/">Squeak</a>, a dialect of <a href="http://www.squeak.org/Smalltalk/">Smalltalk</a>.  Unfortunately, Smalltalk is a pure <a href="http://www.softwaredesign.com/objects.html">object-oriented language</a>, not a functional programming language, and after repeated attempts at approaching Squeak, the basis for Cobalt, I found the GUI-based interface rather difficult to get used to, having come from an <a href="http://en.wikipedia.org/wiki/Emacs">Emacs</a>-based textual environment.  In addition, having come from a functional programming background, I found the concept of object-oriented programming highly counter-intuitive.  (Apparently, I&#8217;m not the only person who has experienced this problem; similar arguments have been advanced by Paul Hudak <a href="http://www.haskell.org/pipermail/haskell-cafe/2007-August/030178.html">[1]</a> and Jonathan A. Rees <a href="http://mumble.net/~jar/articles/oo.html">[2]</a>.)</p>
<p>In short, I was encountering a paradigm-shift problem (with apologies to Shriram Krishnamurthi, who claims <a href="http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-teach-pl-post-linnaean/paper.pdf">[3]</a> that paradigms are ill-defined and hence significantly meaningless).</p>
<p>Here, I was faced with a dilemma:  If I tried using a functional programming language, I would probably need to do a lot of work in writing the necessary libraries for the three-dimensional manipulation of graphical objects, which would additionally require learning linear algebra, which, between my full-time translation job and my busy weekends, I simply did not have enough time to learn.  On the other hand, if I tried using Squeak, then every time I tried to learn the language, I would feel uncomfortable with the object-oriented paradigm, and with the GUI-based environment, and keep returning to such familiar programming languages as Scheme and Haskell, and to such development environments as Emacs.</p>
<p>After some thought, I realized that the problem with learning Squeak did not have to do with any inherent difficulty in Squeak itself; rather, I needed, at least temporarily, to unlearn functional programming and unlearn working in Emacs.  In short, I needed to restore a blank mental slate.  Well, where did I first learn functional programming and Emacs?  Ah, that&#8217;s right:  in college.</p>
<p>Although I couldn&#8217;t actually un-attend college, I could, in a sense, restore my mental state to just before attending college:  What I needed to do was to go back to the past, mentally speaking, to just before college, and approach Squeak with a fresh mind.  To borrow Scheme terminology, I needed to resume the <a href="http://en.wikipedia.org/wiki/Continuation">continuation</a> in the process of my life from just before attending college:  Then it would be straightforward.</p>
<p>One night, just after midnight on Thursday, June 18, 2009, I was walking back home, reminiscing:  Let&#8217;s see &#8230; what was I doing back then.  Going back in time &#8230; </p>
<p>2009,<br />
2008,<br />
2007 (changed jobs again, and became patent translator),<br />
2006 (became patent checker, then changed jobs, and became software project leader),<br />
2005,<br />
2004 (moved from Manhattan to Tokyo),<br />
2003,<br />
2002 (political difficulties at work; job further downgraded to English teacher),<br />
2001 (WTC disaster in Manhattan, where I lived; severe downsizing at workplace resulted; job downgraded to Materials Coordinator),<br />
2000,<br />
1999 (became Localization Coordinator at Berlitz),<br />
1998,<br />
1997 (first moved to Manhattan from New Rochelle, NY),<br />
1996 (began first major job as Systems Engineer in White Plains; moved to New Rochelle from Jersey City),<br />
1995 (first moved to Jersey City from New Haven),<br />
1994 (graduated from college),<br />
1993 (took courses in recursive function theory, philosophical logic, and the lambda calculus, especially enjoying the lambda calculus; first exposure to Haskell in auditing a course on Haskell),<br />
1992 (finished leave of absence and self-study of discrete mathematics; took a course in axiomatic set theory),<br />
1991 (began leave of absence and self-study of discrete mathematics),<br />
1990 (took a course on Pascal and hated it; embarked on Computer Science major; started learning Common Lisp and Scheme: hated Common Lisp because of all the <code>funcall</code>s and idiosyncracies, but enjoyed Scheme because of the relative simplicity and regularity of structure of the language; started learning Emacs; learned how much I did not know, and how stupid I was, and became chronically depressed),<br />
1989 (moved from Tokyo to New Haven, and matriculated at college).</p>
<p>1989.  Ah, there:  Continue from the continuation of my life-process at that point:  the early afternoon of August 31, 1989, just before leaving for Narita Airport to go to New York to take the bus therefrom to New Haven to begin my (dreaded) college studies.</p>
<p>No Emacs.  No Scheme.  No Haskell.  No category theory.  No chronic depression.  Return of math phobia.  Return of Japanese popular music.  Return of a simple mind which is not depressed because it does not know how much it does not know.  Return of interest in <a href="http://en.wikipedia.org/wiki/Multimedia">multimedia</a>.  Aha!</p>
<p>Multimedia:  the missing link!  At that time, I was very interested in the <a href="http://en.wikipedia.org/wiki/FM_Towns">Fujitsu FM Towns</a>, a Japanese personal computer modeled on the <a href="http://en.wikipedia.org/wiki/Macintosh">Macintosh</a>, the interface of which was based on Smalltalk <a href="http://gagne.homedns.org/~tgagne/contrib/EarlyHistoryST.html#29">[4]</a>!  Proceeding to Smalltalk from this continuation would be relatively trivial!</p>
<p>Sometimes, one needs to move backward in order to move forward.</p>
<p>So I decided to resume my continuation from this point on, with a fresh mind.</p>
<p>Resuming continuation&#8230;.</p>
<p>I awoke, as if from a trance.</p>
<p>The next day, I returned to my computer, continuing the continuation.  Suddenly, this strange text-based interface on my screen called &#8220;Emacs&#8221; seemed like a monstrosity that some text-based hacker must have concocted just for the sheer challenge of mastering arcane keystroke-combinations.  Yuck!  There must be a way to do programming without having to master arcane keystroke-combinations.</p>
<p>Let&#8217;s see; where can I find a point-click-drag interface that allows me to program without having to use a textual editor &#8230; preferably, one similar to the graphical user interface of the Fujitsu FM Towns, based on the user interface of the Macintosh&#8230;.</p>
<p>Aha!  what&#8217;s this mouse-face-icon on my desktop labelled &#8220;Squeak?&#8221;  Double-clicking on the icon labelled &#8220;Squeak&#8221;&#8230;.</p>
<p>Hmm &#8230; a colorful background with illustrations.  Sound.  Multimedia.  Point.  Click.  Drag.  How intuitive:  just like the Macintosh interface!  Hmm &#8230; some research shows that it is an implementation of a language called &#8220;Smalltalk,&#8221; the interface of which was the basis for the Macintosh &#8230; what a coincidence &#8230; how curious&#8230;.  I wonder who put it here&#8230;.</p>
<p>Hmm &#8230; found a note here.  It says, &#8220;Note to myself:  Learn Squeak and Cobalt, and build a virtual world using Cobalt, using ideas described on the attached sheet.&#8221;  Sure; why not?</p>
<p>[1] Hudak, Paul. &#8220;[Haskell-cafe] a regressive view of support for imperative programming in Haskell.&#8221; Online posting. 8 Aug. 2007. 25 Aug. 2009. &lt;news://gmane.comp.lang.haskell.cafe&gt;. Also available at &lt;<a href="http://www.haskell.org/pipermail/haskell-cafe/2007-August/030178.html">http://www.haskell.org/pipermail/haskell-cafe/2007-August/030178.html</a>&gt;.</p>
<p>[2] Rees, Jonathan A. &#8220;JAR on Object-Oriented.&#8221; Online posting. 11 May 2003. 25 Aug. 2009. &lt;<a href="http://mumble.net/~jar/articles/oo.html">http://mumble.net/~jar/articles/oo.html</a>&gt;.</p>
<p>[3] Krishnamurthi, Shriram. &#8220;Teaching Programming Languages in a Post-Linnaean Age&#8221;. Cambridge:_2008 SIGPLAN Workshop on Programming Language Curriculum_ (2008): 81-83. &lt;<a href="http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-teach-pl-post-linnaean/paper.pdf">http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-teach-pl-post-linnaean/paper.pdf</a>&gt;.</p>
<p>[4] Kay, Alan C. &#8220;The Early History of Smalltalk.&#8221; Cambridge, Massachusetts: _History of Programming Languages: The second ACM SIGPLAN conference on History of programming languages_ (1993): 69-95. &lt;<a href="http://portal.acm.org/citation.cfm?id=154766.155364&amp;coll=GUIDE&amp;dl=GUIDE&amp;CFID=45415434&amp;CFTOKEN=84716013">http://portal.acm.org/citation.cfm?id=154766.155364&amp;coll=GUIDE&amp;dl=GUIDE&amp;CFID=45415434&amp;CFTOKEN=84716013</a>&gt;. Also available at &lt;<a href="http://gagne.homedns.org/~tgagne/contrib/EarlyHistoryST.html#29">http://gagne.homedns.org/~tgagne/contrib/EarlyHistoryST.html#29</a>&gt;.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dekudekuplex.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dekudekuplex.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dekudekuplex.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dekudekuplex.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dekudekuplex.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dekudekuplex.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dekudekuplex.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dekudekuplex.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dekudekuplex.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dekudekuplex.wordpress.com/227/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=227&subd=dekudekuplex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dekudekuplex.wordpress.com/2009/08/25/paradigm-shift-back-to-the-past-and-no-small-talk-about-smalltalk/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a5af05af2cafbe739659871b86a07820?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Benjamin L. Russell</media:title>
		</media:content>
	</item>
		<item>
		<title>Thinking in Scheme and Checking a Patent Claim: A Cross-disciplinary Application of Scheme-based Reasoning</title>
		<link>http://dekudekuplex.wordpress.com/2009/08/24/thinking-in-scheme-and-checking-a-patent-claim-a-cross-disciplinary-application-of-scheme-based-reasoning/</link>
		<comments>http://dekudekuplex.wordpress.com/2009/08/24/thinking-in-scheme-and-checking-a-patent-claim-a-cross-disciplinary-application-of-scheme-based-reasoning/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 07:27:05 +0000</pubDate>
		<dc:creator>Benjamin L. Russell</dc:creator>
				<category><![CDATA[Programming Language Theory]]></category>
		<category><![CDATA[Scheme]]></category>

		<guid isPermaLink="false">http://dekudekuplex.wordpress.com/?p=212</guid>
		<description><![CDATA[(This content of this post is based on the content of my post [1] entitled “Re: [semi-OT] possible benefits from training in Scheme programming in patent translation” on the USENET newsgroup comp.lang.scheme.)
As a follow-up to my previous post, &#8220;How Scheme Can Train the Mind: One Reason that MIT Should Reinstate Scheme and 6.001,&#8221; here is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=212&subd=dekudekuplex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>(This content of this post is based on the content of my post [1] entitled “Re: [semi-OT] possible benefits from training in Scheme programming in patent translation” on the USENET newsgroup comp.lang.scheme.)</p>
<p>As a follow-up to my previous post, &#8220;<a title="How Scheme Can Train the Mind: One Reason that MIT Should Reinstate Scheme and 6.001" href="http://dekudekuplex.wordpress.com/2009/08/19/how-scheme-can-train-the-mind-one-reason-that-mit-should-reinstate-scheme-and-6-001/#comments">How Scheme Can Train the Mind: One Reason that MIT Should Reinstate Scheme and 6.001</a>,&#8221; here is an example of an application of the Scheme-style pattern of thinking applied to checking a pattern claim.</p>
<p>Most readers of this blog do not read Japanese; therefore, this example assumes that another translator has already translated a patent claim from Japanese to English, and that I need to check the translation for accuracy.  In order to do so, I need to break down the claim into its semantic components and determine whether the semantics of the translation and the original are equivalent.  Here is a contrived example, assuming that somebody has developed an <em>in vitro,</em> as opposed to <em>in vivo,</em> remote control device and receptor that can be optionally mounted on the ear (similarly to the ear-mounted transmitter/receivers worn by Agents in the motion picture saga <em>The Matrix</em>) and used as a controller for a video gaming device; please note that since I am not actually writing a Scheme program, but only using thought patterns derived from writing S-expressions in Scheme programs, this is merely pseudo-Scheme, not actual Scheme:</p>
<p>What is claimed is:</p>
<pre class="syntax-highlight"><span class="synConstant">1.</span> An <em>in vitro</em> remote-control <span class="synError">device,</span> the device comprising:
        a mounting unit for mounting the remote-control device on a portion of the head of a user<span class="synComment">; </span>
        a transmitter <span class="synError">unit,</span> further comprising:
             a neurotransmitter unit transmitting neural impulses to a brain of the user<span class="synComment">; </span>
             a neuro-digital conversion unit converting neural impulses to digital signals<span class="synComment">; </span>
	a receiver <span class="synError">unit,</span> further comprising:
             a neuroreceptor unit receiving neural impulses from the brain<span class="synComment">;</span>
             a digital-neuro conversion unit converting digital signals to neural impulses<span class="synComment">; and </span>
        a power source unit converting thermal radiation from brain cells into electricity, the electricity powering the remote-control device<span class="synComment">;</span>
   wherein:
        the transmitter unit transmits digital signals in response to neural impulses<span class="synComment">; and</span>
        the receiver unit transmits neural impulses in response to digital signals.</pre>
<p>The above-mentioned claim translates roughly into my personal variety of pseudo-Scheme as follows (apologies for any deviations from the syntax <span class="synStatement">or</span> semantics of actual Scheme):</p>
<pre class="syntax-highlight"><span class="synSpecial">(</span>claim-define <span class="synSpecial">(</span>_in-vitro_-remote-control-device mounting-unit transmitter-unit receiver-unit power-source-unit<span class="synSpecial">)</span>
              <span class="synSpecial">(</span>claim-comprising
               <span class="synSpecial">(</span>mounting-unit
                <span class="synSpecial">(</span><span class="synStatement">lambda</span> <span class="synSpecial">(</span>head user<span class="synSpecial">)</span>
                  <span class="synSpecial">(</span>mount head user<span class="synSpecial">)))</span>
               <span class="synSpecial">(</span>transmitter-unit
                <span class="synSpecial">(</span><span class="synStatement">lambda</span> <span class="synSpecial">(</span>neurotransmitter-unit neuro-digital-conversion-unit<span class="synSpecial">)</span>
                  <span class="synSpecial">(</span>claim-define <span class="synSpecial">(</span>neutrotransmitter-unit neural-impulses brain<span class="synSpecial">)</span>
                                <span class="synSpecial">(</span>transmit neural-impulses brain user<span class="synSpecial">))</span>
                  <span class="synSpecial">(</span>claim-define <span class="synSpecial">(</span>neuro-digital-conversion-unit neural-impulses digital-signals<span class="synSpecial">)</span>
                                <span class="synSpecial">(</span>convert <span class="synSpecial">(</span>neural-impulses digital-signals<span class="synSpecial">))))</span>
                <span class="synSpecial">(</span>receiver-unit
                 <span class="synSpecial">(</span><span class="synStatement">lambda</span> <span class="synSpecial">(</span>neuroreceptor-unit digital-neuro-conversion-unit<span class="synSpecial">)</span>
                   <span class="synSpecial">(</span>claim-define <span class="synSpecial">(</span>neuroreceptor-unit neural-impulses brain<span class="synSpecial">)</span>
                                 <span class="synSpecial">(</span>receive neural-impulses brain<span class="synSpecial">))</span>
                   <span class="synSpecial">(</span>claim-define <span class="synSpecial">(</span>digital-neuro-conversion-unit<span class="synSpecial">)</span>
                                 <span class="synSpecial">(</span>convert digital-signals neural-impulses<span class="synSpecial">))))</span>
                <span class="synSpecial">(</span>power-source-unit
                 <span class="synSpecial">(</span><span class="synStatement">lambda</span> <span class="synSpecial">(</span>thermal-radiation brain-cells electricity<span class="synSpecial">)</span>
                   <span class="synSpecial">(</span>power-convert thermal-radiation electricity brain-cells<span class="synSpecial">)))))</span>
                <span class="synSpecial">(</span>claim-wherein
                 <span class="synSpecial">(</span>transmitter-unit
                  <span class="synSpecial">(</span><span class="synStatement">lambda</span> <span class="synSpecial">(</span>digital-signals neural-impulses<span class="synSpecial">)</span>
                    <span class="synSpecial">(</span>transmit digital-signals neural-impulses<span class="synSpecial">)))</span>
                 <span class="synSpecial">(</span>receiver-unit
                  <span class="synSpecial">(</span><span class="synStatement">lambda</span> <span class="synSpecial">(</span>neural-impulses digital-signals<span class="synSpecial">)</span>
                    <span class="synSpecial">(</span>transmit neural-impulses digital-signals<span class="synSpecial">)))))</span></pre>
<p>This pattern of thinking can greatly simplify verifying equivalence between an English translation of a claim having a complex structure and the original Japanese claim.</p>
<p>[1] Russell, Benjamin L. “Re: [semi-OT] possible benefits from training in Scheme programming in patent translation.” Online posting. 20 Aug. 2009. 24 Aug. 2009. &lt;<a title="news://comp.lang.scheme" href="news://comp.lang.scheme">news://comp.lang.scheme</a>&gt;.  Also available at <a title="http://groups.google.co.jp/group/comp.lang.scheme/msg/871965c4090e127f" href="http://groups.google.co.jp/group/comp.lang.scheme/msg/871965c4090e127f">&lt;http://groups.google.co.jp/group/comp.lang.scheme/msg/871965c4090e127f</a>&gt;.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dekudekuplex.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dekudekuplex.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dekudekuplex.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dekudekuplex.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dekudekuplex.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dekudekuplex.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dekudekuplex.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dekudekuplex.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dekudekuplex.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dekudekuplex.wordpress.com/212/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=212&subd=dekudekuplex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dekudekuplex.wordpress.com/2009/08/24/thinking-in-scheme-and-checking-a-patent-claim-a-cross-disciplinary-application-of-scheme-based-reasoning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a5af05af2cafbe739659871b86a07820?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Benjamin L. Russell</media:title>
		</media:content>
	</item>
		<item>
		<title>How Scheme Can Train the Mind: One Reason that MIT Should Reinstate Scheme and 6.001</title>
		<link>http://dekudekuplex.wordpress.com/2009/08/19/how-scheme-can-train-the-mind-one-reason-that-mit-should-reinstate-scheme-and-6-001/</link>
		<comments>http://dekudekuplex.wordpress.com/2009/08/19/how-scheme-can-train-the-mind-one-reason-that-mit-should-reinstate-scheme-and-6-001/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 12:32:56 +0000</pubDate>
		<dc:creator>Benjamin L. Russell</dc:creator>
				<category><![CDATA[Programming Language Theory]]></category>
		<category><![CDATA[Scheme]]></category>

		<guid isPermaLink="false">http://dekudekuplex.wordpress.com/?p=202</guid>
		<description><![CDATA[(This content of this post is substantially identical to the content of my post [1] entitled &#8220;[semi-OT] possible benefits from training in Scheme programming in patent translation&#8221; on the USENET newsgroup comp.lang.scheme.)
Today, I came across an interesting phenomenon in which exposure to Scheme programming helped with technical translation of part of a patent specification.
Since the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=202&subd=dekudekuplex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>(This content of this post is substantially identical to the content of my post [1] entitled &#8220;[semi-OT] possible benefits from training in Scheme programming in patent translation&#8221; on the USENET newsgroup comp.lang.scheme.)</p>
<blockquote><p>Today, I came across an interesting phenomenon in which exposure to Scheme programming helped with technical translation of part of a patent specification.</p>
<p>Since the material is classified, I can only reveal the structure, and not the content, but basically, there was a document containing a &#8220;claim&#8221; (a sentence in a specification which specifies what is being claimed in the patent being applied for) which somebody had slightly mis-translated from English to Japanese, and which was being amended.</p>
<p>The original English clause in the claim had the following structure:</p>
<p>&#8220;&#8230; an A in communication with a plurality of B, said A configured to generate a C signal, configured to cause at least one of said plurality of B to output a said D, said C signal based at least in part on said E signal.&#8221;</p>
<p>Unfortunately, whoever translated that clause from English to Japanese apparently left out the &#8220;said A configured to generate a C signal&#8221; portion.</p>
<p>Then this mis-translated Japanese translation of the original English clause was amended, but was never translated back to English.</p>
<p>Then this amended Japanese clause was re-amended, and I was asked to &#8220;apply&#8221; the re-amendment to the English original.  The re-amended Japanese clause then had the following structure (after I finally figured out the structure):</p>
<p>&#8220;&#8230; an A in communication with a plurality of B, said A configured to generate a C signal, configured to cause the C coupled to said F so that a positional relationship, for the E which has sent the E signal, corresponding similarly to a positional relationship between the E which has sent the E signal and the G of said plurality of B to output a said force associated with the strength detected by the E, said B signal based on said E signal.&#8221;</p>
<p>The first aspect that I noticed was that the previous amendment had never been translated, requiring me to fill in the details.</p>
<p>However, then I noticed that this previous amendment had itself been based on a mis-translated original.</p>
<p>In order to figure out which portion was missing from the translation of the original clause, I needed to map portions of the original English clause to their Japanese equivalents, but since the structure itself was not written to reflect the structure of the original English clause, I then needed to break up the original English clause into its structural components.</p>
<p>At first, this process seemed very tedious and difficult, until I noticed that treating these structural components in the clause as if they were S-expressions in a Scheme program, and then mapping equivalent components of the English clause to semi-corresponding components of the Japanese (mis-)translation speeded up and simplified this process greatly, even though the correspondence was not exact.</p>
<p>For some reason, I have discovered that this kind of mental equivalence seems to proceed much more smoothly between S-expressions in Scheme programs and claims in patent documents than between other kinds of expressions in other functional programming languages and the same claims in patent documents.  For example, I have not had similar experiences with finding equivalences between expressions in even Haskell programs and the claims in patent documents; Haskell expressions seem to be more equivalent to mathematical equations than to claims in patent documents.</p>
<p>Therefore, it seems that exposure to the Scheme programming language, in particular, can help in training non-programmers to think structurally in analyzing expressions in natural language, which can have benefits in translating claims in patent documents in such a manner that they can be more easily and clearly amended.</p>
<p>Perhaps MIT should reinstate Scheme and 6.001, and get rid of Python and the new C1.  Somehow I feel that MIT is risking creating a new generation of idiots by getting rid of Scheme and SICP from their curriculum just for the ostensible reason that the recursive style of programming does not reflect the way that programming is actually conducted in industry.  Students do not learn programming just to program; learning programming also has important  ramifications for the structural thought processes underlying other technical fields, even those that do not  seem superficially related (such as patent translation), and it seems that watering down a core programming  course for such ostensible reasons undermines the crucial patterns of thinking which are cross-applicable to such  other technical fields as well.</p>
<p>[1] Russell, Benjamin L. &#8220;[semi-OT] possible benefits from training in Scheme programming in patent translation.&#8221; Online posting. 19 Aug. 2009. 19 Aug. 2009. &lt;<a title="news://comp.lang.scheme" href="news://comp.lang.scheme">news://comp.lang.scheme</a>&gt;. Also available at <a title="http://groups.google.com/group/comp.lang.scheme/browse_thread/thread/4590474ce458597c#" href="http://groups.google.com/group/comp.lang.scheme/browse_thread/thread/4590474ce458597c#">&lt;http://groups.google.com/group/comp.lang.scheme/browse_thread/thread/4590474ce458597c#</a>&gt;.</p></blockquote>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dekudekuplex.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dekudekuplex.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dekudekuplex.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dekudekuplex.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dekudekuplex.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dekudekuplex.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dekudekuplex.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dekudekuplex.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dekudekuplex.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dekudekuplex.wordpress.com/202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=202&subd=dekudekuplex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dekudekuplex.wordpress.com/2009/08/19/how-scheme-can-train-the-mind-one-reason-that-mit-should-reinstate-scheme-and-6-001/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a5af05af2cafbe739659871b86a07820?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Benjamin L. Russell</media:title>
		</media:content>
	</item>
		<item>
		<title>Climbing the Towers of Hanoi with Haskell-style Curry from a Monadic Container (While Sparing the Sugar!)</title>
		<link>http://dekudekuplex.wordpress.com/2009/04/13/climbing-the-towers-of-hanoi-with-haskell-style-curry-from-a-monadic-container-while-sparing-the-sugar/</link>
		<comments>http://dekudekuplex.wordpress.com/2009/04/13/climbing-the-towers-of-hanoi-with-haskell-style-curry-from-a-monadic-container-while-sparing-the-sugar/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 10:59:19 +0000</pubDate>
		<dc:creator>Benjamin L. Russell</dc:creator>
				<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Monads]]></category>
		<category><![CDATA[Programming Language Theory]]></category>

		<guid isPermaLink="false">http://dekudekuplex.wordpress.com/?p=184</guid>
		<description><![CDATA[Have you ever felt like eating some Haskellian curry on your way to the top of the Towers of Hanoi, but could do without the sugar in the container?  Well, here&#8217;s how&#8230;.
Previously, I had posted the following solution to the Towers of Hano problem:

hanoi :: a -&#62; a -&#62; a -&#62; Int -&#62; [(a, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=184&subd=dekudekuplex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Have you ever felt like eating some <a href="http://www.haskell.org/">Haskell</a>ian <a href="http://en.wikipedia.org/wiki/Haskell_Curry">curry</a> on your way to the top of the <a href="http://en.wikipedia.org/wiki/Tower_of_Hanoi">Towers of Hanoi</a>, but could do without the <a href="http://www.haskell.org/haskellwiki/Syntactic_sugar">sugar</a> in the <a href="http://www.haskell.org/haskellwiki/Monads_as_containers">container</a>?  Well, here&#8217;s how&#8230;.</p>
<p><a href="http://dekudekuplex.wordpress.com/2008/11/18/towers-of-hanoi-2/">Previously</a>, I had posted the following solution to the Towers of Hano problem:</p>
<blockquote>
<pre class="syntax-highlight">hanoi <span class="synStatement">::</span> a <span class="synStatement">-&gt;</span> a <span class="synStatement">-&gt;</span> a <span class="synStatement">-&gt;</span> Int <span class="synStatement">-&gt;</span> [(a, a)]
hanoi source using dest n
    <span class="synStatement">|</span> n <span class="synStatement">==</span> <span class="synConstant">0</span> <span class="synStatement">=</span> []
    <span class="synStatement">|</span> n <span class="synStatement">==</span> <span class="synConstant">1</span> <span class="synStatement">=</span> [(source, dest)]
    <span class="synStatement">|</span> otherwise <span class="synStatement">=</span> hanoi source dest using (n<span class="synStatement">-</span><span class="synConstant">1</span>)
                  <span class="synStatement">++</span> hanoi source using dest <span class="synConstant">1</span>
                         <span class="synStatement">++</span> hanoi using source dest (n<span class="synStatement">-</span><span class="synConstant">1</span>)

hanoi_shower <span class="synStatement">::</span> Show a <span class="synStatement">=&gt;</span> [(a, a)] <span class="synStatement">-&gt;</span> String
hanoi_shower [] <span class="synStatement">=</span> <span class="synConstant">""</span>
hanoi_shower ((a, b)<span class="synStatement">:</span>moves) <span class="synStatement">=</span> unlines [<span class="synConstant">"Move "</span> <span class="synStatement">++</span> show a <span class="synStatement">++</span> <span class="synConstant">" to "</span><span class="synStatement">++</span> show b <span class="synStatement">++</span> <span class="synConstant">"."</span>] <span class="synStatement">++</span> hanoi_shower moves</pre>
</blockquote>
<p>However, this function seemed somewhat difficult to understand at a glance, and had the problem that it needed to be called as follows:</p>
<blockquote>
<pre>putStr (hanoi_shower (hanoi 'a' 'b' 'c' 3))</pre>
</blockquote>
<p>Thereupon, the function would reward the user with the following results:</p>
<blockquote>
<pre>Move 'a' to 'c'.
Move 'a' to 'b'.
Move 'c' to 'b'.
Move 'a' to 'c'.
Move 'b' to 'a'.
Move 'b' to 'c'.
Move 'a' to 'c'.</pre>
</blockquote>
<p>While technically a solution, this function had never seemed an entirely satisfactory counterpart to my earlier <a href="http://dekudekuplex.wordpress.com/2008/11/18/towers-of-hanoi/">Scheme solution</a> (part of the text in the output statement thereof below has been slightly reworded from &#8220;&#8230; from disc&#8221; to &#8220;&#8230; disc from&#8221; here for readability) to the same problem:</p>
<blockquote>
<pre class="syntax-highlight"><span class="synSpecial">(</span><span class="synStatement">define</span> <span class="synSpecial">(</span>hanoi n<span class="synSpecial">)</span>
  <span class="synSpecial">(</span>hanoi-helper <span class="synSpecial">'</span>A <span class="synSpecial">'</span>B <span class="synSpecial">'</span>C n<span class="synSpecial">))</span>

<span class="synSpecial">(</span><span class="synStatement">define</span> <span class="synSpecial">(</span>hanoi-helper source using destination n<span class="synSpecial">)</span>
  <span class="synSpecial">(</span><span class="synStatement">cond</span> <span class="synSpecial">((</span><span class="synIdentifier">=</span> n <span class="synConstant">1</span><span class="synSpecial">)</span>
         <span class="synSpecial">(</span>printf <span class="synConstant">"Moving disc from ~a to ~a.\n"</span> source destination<span class="synSpecial">))</span>
        <span class="synSpecial">(</span><span class="synStatement">else</span>
         <span class="synSpecial">(</span>hanoi-helper source destination using <span class="synSpecial">(</span><span class="synIdentifier">-</span> n <span class="synConstant">1</span><span class="synSpecial">))</span>
         <span class="synSpecial">(</span>hanoi-helper source using destination <span class="synConstant">1</span><span class="synSpecial">)</span>
         <span class="synSpecial">(</span>hanoi-helper using source destination <span class="synSpecial">(</span><span class="synIdentifier">-</span> n <span class="synConstant">1</span><span class="synSpecial">)))))</span></pre>
</blockquote>
<p>In particular, the Scheme version could be invoked quite simply as follows:</p>
<blockquote>
<pre>(hanoi 3)</pre>
</blockquote>
<p>Thereupon, it would reward the user with the following results:</p>
<blockquote>
<pre>Moving disc from A to C.
Moving disc from A to B.
Moving disc from C to B.
Moving disc from A to C.
Moving disc from B to A.
Moving disc from B to C.
Moving disc from A to C.</pre>
</blockquote>
<p>Why not the Haskell version?</p>
<p>At first, not understanding how to use monads correctly, I tried to write the following (incorrect) version, thinking that I could just concatenate the results of the recursive calls into one long string:</p>
<blockquote>
<pre class="syntax-highlight">hanoi <span class="synStatement">::</span> Integer <span class="synStatement">-&gt;</span> IO ()
hanoi n <span class="synStatement">=</span> hanoiHelper n <span class="synConstant">"A"</span> <span class="synConstant">"B"</span> <span class="synConstant">"C"</span>

hanoiHelper <span class="synStatement">::</span> Integer <span class="synStatement">-&gt;</span> String <span class="synStatement">-&gt;</span> String <span class="synStatement">-&gt;</span> String <span class="synStatement">-&gt;</span> IO ()
hanoiHelper n source dest using
                <span class="synStatement">|</span> n <span class="synStatement">==</span> <span class="synConstant">1</span> <span class="synStatement">=</span> putStrLn (<span class="synConstant">"Move disc from "</span> <span class="synStatement">++</span> source <span class="synStatement">++</span> <span class="synConstant">" to "</span> <span class="synStatement">++</span> dest <span class="synStatement">++</span> <span class="synConstant">"."</span>)
                <span class="synStatement">|</span> otherwise <span class="synStatement">=</span> hanoiHelper (n<span class="synStatement">-</span><span class="synConstant">1</span>) source using dest
                              <span class="synStatement">++</span> hanoiHelper <span class="synConstant">1</span> source dest using
                              <span class="synStatement">++</span> hanoiHelper (n<span class="synStatement">-</span><span class="synConstant">1</span>) using dest source</pre>
</blockquote>
<p>However, attempting to load this function into <a href="http://code.google.com/p/winghci/">WinGhci</a> resulted in the following error message:</p>
<blockquote>
<pre>    Couldn't match expected type `[a]' against inferred type `IO ()'
    In the first argument of `(++)', namely
        `hanoiHelper (n - 1) source using dest'
    In the expression:
          hanoiHelper (n - 1) source using dest
        ++  hanoiHelper 1 source dest using
          ++
            hanoiHelper (n - 1) using dest source
    In the definition of `hanoiHelper':
        hanoiHelper n source dest using
                      | n == 1
                      = putStrLn ("Move disc from " ++ source ++ " to " ++ dest ++ ".")
                      | otherwise
                      = hanoiHelper (n - 1) source using dest
                      ++  hanoiHelper 1 source dest using
                        ++
                          hanoiHelper (n - 1) using dest source</pre>
</blockquote>
<p>Since the error message reported that the expected type of hanoiHelper was `[a]&#8216;, I then tried modifying the type signature for hanoiHelper accordingly, as follows:</p>
<blockquote>
<pre class="syntax-highlight">hanoiHelper <span class="synStatement">::</span> Integer <span class="synStatement">-&gt;</span> String <span class="synStatement">-&gt;</span> String <span class="synStatement">-&gt;</span> String <span class="synStatement">-&gt;</span> [a]</pre>
</blockquote>
<p>Unfortunately, this only reported in the converse error, thus:</p>
<blockquote>
<pre>[1 of 1] Compiling Main             ( hanoiIncorrect.hs, interpreted )

hanoiIncorrect.hs:9:10:
    Couldn't match expected type `IO ()' against inferred type `[a]'
    In the expression: hanoiHelper n "A" "B" "C"
    In the definition of `hanoi': hanoi n = hanoiHelper n "A" "B" "C"

hanoiIncorrect.hs:13:27:
    Couldn't match expected type `[a]' against inferred type `IO ()'
    In the expression:
        putStrLn ("Move disc from " ++ source ++ " to " ++ dest ++ ".")
    In the definition of `hanoiHelper':
        hanoiHelper n source dest using
                      | n == 1
                      = putStrLn ("Move disc from " ++ source ++ " to " ++ dest ++ ".")
                      | otherwise
                      = hanoiHelper (n - 1) source using dest
                      ++  hanoiHelper 1 source dest using
                        ++
                          hanoiHelper (n - 1) using dest source
Failed, modules loaded: none.</pre>
</blockquote>
<p>Stumped, I came across the <a href="http://www.rosettacode.org/w/index.php?title=Towers_of_Hanoi#Haskell">following</a> example of code for solving this problem:</p>
<blockquote>
<pre class="syntax-highlight"> hanoiM <span class="synStatement">::</span> Integer <span class="synStatement">-&gt;</span> IO ()
 hanoiM n <span class="synStatement">=</span> hanoiM' n <span class="synConstant">1</span> <span class="synConstant">2</span> <span class="synConstant">3</span> <span class="synType">where</span>
   hanoiM' <span class="synConstant">0</span> a b c <span class="synStatement">=</span> return ()
   hanoiM' n a b c <span class="synStatement">=</span> <span class="synStatement">do</span>
     hanoiM' (n<span class="synStatement">-</span><span class="synConstant">1</span>) a c b
     putStrLn <span class="synStatement">$</span> <span class="synConstant">"Move "</span> <span class="synStatement">++</span> show a <span class="synStatement">++</span> <span class="synConstant">" to "</span> <span class="synStatement">++</span> show b
     hanoiM' (n<span class="synStatement">-</span><span class="synConstant">1</span>) c b a</pre>
</blockquote>
<p>However, I wasn&#8217;t satisfied with this solution, because the syntactic sugar of the do-notation obscured the semantics of what was happening.  I liked to have my Haskell curry without sugar.</p>
<p>Then I came across the following <a href="http://haskell.org/haskellwiki/IO_inside#.27.3E.3E.3D.27_and_.27do.27_notation">explanation</a> of an unsugared monad:</p>
<blockquote><p>Let&#8217;s examine how to desugar a &#8216;do&#8217; with multiple statements in the following example:</p>
<pre class="haskell">main = <span style="color:#000099;">do</span> <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:putStr"><span style="color:#006600;">putStr</span></a> <span style="color:#003300;">"What is your name?"</span>
          <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:putStr"><span style="color:#006600;">putStr</span></a> <span style="color:#003300;">"How old are you?"</span>
          <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:putStr"><span style="color:#006600;">putStr</span></a> <span style="color:#003300;">"Nice day!"</span></pre>
<p>The &#8216;do&#8217; statement here just joins several IO actions that should be performed sequentially. It&#8217;s translated to sequential applications of one of the so-called &#8220;binding operators&#8221;, namely &#8216;&gt;&gt;&#8217;:</p>
<pre class="haskell">main = <span style="color:black;">(</span><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:putStr"><span style="color:#006600;">putStr</span></a> <span style="color:#003300;">"What is your name?"</span><span style="color:black;">)</span>
       <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:&amp;gt;"><span style="color:#006600;">&gt;&gt;</span></a> <span style="color:black;">(</span> <span style="color:black;">(</span><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:putStr"><span style="color:#006600;">putStr</span></a> <span style="color:#003300;">"How old are you?"</span><span style="color:black;">)</span>
            <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:&amp;gt;"><span style="color:#006600;">&gt;&gt;</span></a> <span style="color:black;">(</span><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:putStr"><span style="color:#006600;">putStr</span></a> <span style="color:#003300;">"Nice day!"</span><span style="color:black;">)</span>
          <span style="color:black;">)</span></pre>
</blockquote>
<p>After comparing the two examples and looking at the nesting of parentheses for a while, I suddenly realized that monads must be some kind of <a href="http://www.haskell.org/haskellwiki/Monads_as_containers">container</a>.  Apparently, the monads served to contain something inside that was undesirable in a purely functional environment outside, and the bind (&#8220;&gt;&gt;&#8221;) notation could be nested to enforce sequencing on the execution order.</p>
<p>After some thought, I came up with the corresponding Haskell solution; <em>viz</em>.:</p>
<blockquote>
<pre class="syntax-highlight">hanoi <span class="synStatement">::</span> Integer <span class="synStatement">-&gt;</span> IO ()
hanoi n <span class="synStatement">=</span> hanoiHelper n <span class="synConstant">"A"</span> <span class="synConstant">"B"</span> <span class="synConstant">"C"</span> <span class="synType">where</span>
    hanoiHelper <span class="synConstant">1</span> source dest using <span class="synStatement">=</span> putStrLn (<span class="synConstant">"Move disc from "</span> <span class="synStatement">++</span> source <span class="synStatement">++</span> <span class="synConstant">" to "</span> <span class="synStatement">++</span> dest <span class="synStatement">++</span> <span class="synConstant">"."</span>)
    hanoiHelper n source dest using <span class="synStatement">=</span> (hanoiHelper (n<span class="synStatement">-</span><span class="synConstant">1</span>) source using dest)
                                      <span class="synStatement">&gt;&gt;</span> ( (hanoiHelper <span class="synConstant">1</span> source dest using)
                                           <span class="synStatement">&gt;&gt;</span> (hanoiHelper (n<span class="synStatement">-</span><span class="synConstant">1</span>) using dest source)
                                         )</pre>
</blockquote>
<p>This function type-checked correctly, and could be summoned as follows:</p>
<blockquote>
<pre>hanoi 3</pre>
</blockquote>
<p>Thereupon, similarly to its Scheme counterpart, it would now reward the user as follows:</p>
<blockquote>
<pre>Move disc from A to B.
Move disc from A to C.
Move disc from B to C.
Move disc from A to B.
Move disc from C to A.
Move disc from C to B.
Move disc from A to B.</pre>
</blockquote>
<p>For those who prefer <a href="http://www.haskell.org/haskellwiki/Monad#Special_notation">do</a>-notation, here is the same function sweetened with syntactic sugar:</p>
<blockquote>
<pre class="syntax-highlight">hanoi <span class="synStatement">::</span> Integer <span class="synStatement">-&gt;</span> IO ()
hanoi n <span class="synStatement">=</span> hanoiHelper n <span class="synConstant">"A"</span> <span class="synConstant">"B"</span> <span class="synConstant">"C"</span> <span class="synType">where</span>
    hanoiHelper <span class="synConstant">1</span> source dest using <span class="synStatement">=</span> putStrLn (<span class="synConstant">"Move disc from "</span> <span class="synStatement">++</span> source <span class="synStatement">++</span> <span class="synConstant">" to "</span> <span class="synStatement">++</span> dest <span class="synStatement">++</span> <span class="synConstant">"."</span>)
    hanoiHelper n source dest using <span class="synStatement">=</span> <span class="synStatement">do</span>
                                      hanoiHelper (n<span class="synStatement">-</span><span class="synConstant">1</span>) source using dest
                                      hanoiHelper <span class="synConstant">1</span> source dest using
                                      hanoiHelper (n<span class="synStatement">-</span><span class="synConstant">1</span>) using dest source</pre>
</blockquote>
<p>Although almost a direct counterpart to the corresponding Scheme version, it was still not structured similarly as a main function and a helper function; I wanted to divide it correspondingly.</p>
<p>Eventually, I came up with the following corresponding solution, which also used a helper function:</p>
<blockquote>
<pre class="syntax-highlight">hanoi <span class="synStatement">::</span> Integer <span class="synStatement">-&gt;</span> IO ()
hanoi n <span class="synStatement">=</span> hanoiHelper n <span class="synConstant">"A"</span> <span class="synConstant">"B"</span> <span class="synConstant">"C"</span>

hanoiHelper <span class="synStatement">::</span> Integer <span class="synStatement">-&gt;</span> String <span class="synStatement">-&gt;</span> String <span class="synStatement">-&gt;</span> String <span class="synStatement">-&gt;</span> IO ()
hanoiHelper n source dest using
                <span class="synStatement">|</span> n <span class="synStatement">==</span> <span class="synConstant">1</span> <span class="synStatement">=</span> putStrLn (<span class="synConstant">"Move disc from "</span> <span class="synStatement">++</span> source <span class="synStatement">++</span> <span class="synConstant">" to "</span> <span class="synStatement">++</span> dest <span class="synStatement">++</span> <span class="synConstant">"."</span>)
                <span class="synStatement">|</span> otherwise <span class="synStatement">=</span> (hanoiHelper (n<span class="synStatement">-</span><span class="synConstant">1</span>) source using dest)
                                      <span class="synStatement">&gt;&gt;</span> ( (hanoiHelper <span class="synConstant">1</span> source dest using)
                                           <span class="synStatement">&gt;&gt;</span> (hanoiHelper (n<span class="synStatement">-</span><span class="synConstant">1</span>) using dest source)
                                         )</pre>
</blockquote>
<p>As a bonus, during my research, I chanced upon the following <a href="http://dev-app-in-haskell.blogspot.com/2008/04/operator.html">explanation</a> of the &#8216;$&#8217; operator:</p>
<blockquote>
<h3 class="post-title entry-title"><a href="http://dev-app-in-haskell.blogspot.com/2008/04/operator.html">$ operator</a></h3>
<div class="post-body entry-content">
<p>This is hopefully something worth sharing about Haskell. The <tt>$</tt> operator.</p>
<pre style="background-color:#333333;"><span style="font-family:monospace;color:#ffffff;">
 simpleHTTP <span style="color:#f0e68c;"><strong>$</strong></span> buildRequest req_text

 simpleHTTP ( buildRequest req_text )
</span></pre>
<p>It is an application operator, it takes a function and an argument, and &#8230; applies the function to the argument. It&#8217;s purpose is to save typing parentheses. It is all about operator precedence.</p>
<pre style="background-color:#333333;"><span style="font-family:monospace;color:#ffffff;">
 head <span style="color:#f0e68c;"><strong>.</strong></span> words <span style="color:#f0e68c;"><strong>$</strong></span> config_file_contents

 ( head <span style="color:#f0e68c;"><strong>.</strong></span> words ) config_file_contents
</span></pre>
<p>Application, <tt>f a</tt> (<tt>f</tt> applies to <tt>a</tt>), binds stronger than any operator. If it was an operator, think about multiplication operator which people often omit, it would have precedence set to 10.  <tt>$</tt> has precedence set to 0, which is the lowest value of precedence possible.</p>
<p>The <tt>.</tt> is my another favourite. <tt>(f . g) a == f (g a)</tt> it set to 9, and therefore binds almost as strong as application.</p>
<pre style="background-color:#333333;"><span style="font-family:monospace;color:#ffffff;">
 listActions <span style="color:#f0e68c;"><strong>::</strong></span> String <span style="color:#f0e68c;"><strong>-&gt;</strong></span> [Action]
 listActions <span style="color:#f0e68c;"><strong>=</strong></span> filter notDone <span style="color:#f0e68c;"><strong>.</strong></span> map actionFromMap <span style="color:#f0e68c;"><strong>.</strong></span> parseJSON
</span></pre>
</div>
</blockquote>
<p>Feeling richer with the &#8216;$&#8217;, I rewrote my function, listed below complete with comments and a copyleft disclaimer, to suit my mood accordingly:</p>
<blockquote>
<pre class="syntax-highlight"><span class="synComment">-- hanoiHelpedRich.hs</span>
<span class="synComment">-- Haskell function to compute the Towers of Hanoi problem recursively, </span>
<span class="synComment">-- using a helper function and the '$' operator to take a function and </span>
<span class="synComment">-- an argument, and accordingly save typing parentheses</span>
<span class="synComment">--</span>
<span class="synComment">-- Copyright(C) April 13, 2009, at 19:56, </span>
<span class="synComment">-- by Benjamin L. Russell</span>
<span class="synComment">-- </span>
<span class="synComment">-- This program is free software; you can redistribute it and/or modify</span>
<span class="synComment">-- it under the terms of the GNU General Public License as published by</span>
<span class="synComment">-- the Free Software Foundation; either version 2 of the License, or</span>
<span class="synComment">-- (at your option) any later version.</span>
<span class="synComment">--</span>
<span class="synComment">-- This program is distributed in the hope that it will be useful,</span>
<span class="synComment">-- but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="synComment">-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<span class="synComment">-- GNU General Public License for more details.</span>
<span class="synComment">--</span>
<span class="synComment">-- You should have received a copy of the GNU General Public License</span>
<span class="synComment">-- along with this program; if not, write to the Free Software</span>
<span class="synComment">-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span>

hanoi <span class="synStatement">::</span> Integer <span class="synStatement">-&gt;</span> IO ()
hanoi n <span class="synStatement">=</span> hanoiHelper n <span class="synConstant">"A"</span> <span class="synConstant">"B"</span> <span class="synConstant">"C"</span>

hanoiHelper <span class="synStatement">::</span> Integer <span class="synStatement">-&gt;</span> String <span class="synStatement">-&gt;</span> String <span class="synStatement">-&gt;</span> String <span class="synStatement">-&gt;</span> IO ()
hanoiHelper n source dest using
                <span class="synStatement">|</span> n <span class="synStatement">==</span> <span class="synConstant">1</span> <span class="synStatement">=</span> putStrLn <span class="synStatement">$</span> <span class="synConstant">"Move disc from "</span> <span class="synStatement">++</span> source <span class="synStatement">++</span> <span class="synConstant">" to "</span> <span class="synStatement">++</span> dest <span class="synStatement">++</span> <span class="synConstant">"."</span>
                <span class="synStatement">|</span> otherwise <span class="synStatement">=</span> (hanoiHelper (n<span class="synStatement">-</span><span class="synConstant">1</span>) source using dest)
                                      <span class="synStatement">&gt;&gt;</span> ( (hanoiHelper <span class="synConstant">1</span> source dest using)
                                           <span class="synStatement">&gt;&gt;</span> (hanoiHelper (n<span class="synStatement">-</span><span class="synConstant">1</span>) using dest source)
                                         )</pre>
</blockquote>
<p>Now I am on a diet with fewer parentheses, but with more &#8216;$&#8217; in my pocket.</p>
<p>P.S.</p>
<p>One commentator, augustss, has been kind enough to <a href="http://dekudekuplex.wordpress.ecom/2009/04/13/climbing-the-towers-of-hanoi-with-haskell-style-curry-from-a-monadic-container-while-sparing-the-sugar/#comment-58">point out</a> that my version of hanoi can be rewritten to be less IO-based, and more functional.  Per augustss&#8217;s suggestion, I have rewritten hanoi.hs as follows:</p>
<blockquote>
<div class="body">
<div class="section">
<pre class="syntax-highlight"><span class="synComment">-- hanoiMover.hs</span>
<span class="synComment">-- Originally based on hanoi_v1.1.hs, a Haskell function to compute</span>
<span class="synComment">-- the Towers of Hanoi problem recursively, by Benjamin L. Russell,</span>
<span class="synComment">-- dated April 16, 2008, at 14:17; </span>
<span class="synComment">-- revised based on a comment from augustss, dated April 18, 2009, at</span>
<span class="synComment">-- 17:38, (see</span>
<span class="synComment">-- http://dekudekuplex.wordpress.ecom/2009/04/13/climbing-the-towers-of-hanoi-with-haskell-style-curry-from-a-monadic-container-while-sparing-the-sugar/#comment-58),</span>
<span class="synComment">-- in response to my blog post "Climbing the Towers of Hanoi with</span>
<span class="synComment">-- Haskell-style Curry from a Monadic Container (While Sparing the </span>
<span class="synComment">-- Sugar!)," dated April 13, 2009, at 19:59 (see</span>
<span class="synComment">-- http://dekudekuplex.wordpress.com/2009/04/13/climbing-the-towers-of-hanoi-with-haskell-style-curry-from-a-monadic-container-while-sparing-the-sugar/)</span>
<span class="synComment">--</span>
<span class="synComment">-- Copyright(C) April 20, 2009, at 18:38, </span>
<span class="synComment">-- by Benjamin L. Russell</span>
<span class="synComment">-- </span>
<span class="synComment">-- This program is free software; you can redistribute it and/or modify</span>
<span class="synComment">-- it under the terms of the GNU General Public License as published by</span>
<span class="synComment">-- the Free Software Foundation; either version 2 of the License, or</span>
<span class="synComment">-- (at your option) any later version.</span>
<span class="synComment">--</span>
<span class="synComment">-- This program is distributed in the hope that it will be useful,</span>
<span class="synComment">-- but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="synComment">-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<span class="synComment">-- GNU General Public License for more details.</span>
<span class="synComment">--</span>
<span class="synComment">-- You should have received a copy of the GNU General Public License</span>
<span class="synComment">-- along with this program; if not, write to the Free Software</span>
<span class="synComment">-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span>

hanoi <span class="synStatement">::</span> Integer <span class="synStatement">-&gt;</span> IO ()
hanoi <span class="synStatement">=</span> putStr <span class="synStatement">.</span> hanoiShower <span class="synStatement">.</span> hanoiMover <span class="synConstant">'a'</span> <span class="synConstant">'b'</span> <span class="synConstant">'c'</span>

hanoiMover <span class="synStatement">::</span> a <span class="synStatement">-&gt;</span> a <span class="synStatement">-&gt;</span> a <span class="synStatement">-&gt;</span> Integer <span class="synStatement">-&gt;</span> [(a, a)]
hanoiMover source using dest n
    <span class="synStatement">|</span> n <span class="synStatement">==</span> <span class="synConstant">0</span> <span class="synStatement">=</span> []
    <span class="synStatement">|</span> n <span class="synStatement">==</span> <span class="synConstant">1</span> <span class="synStatement">=</span> [(source, dest)]
    <span class="synStatement">|</span> otherwise <span class="synStatement">=</span> hanoiMover source dest using (n<span class="synStatement">-</span><span class="synConstant">1</span>)
                  <span class="synStatement">++</span> hanoiMover source using dest <span class="synConstant">1</span>
                         <span class="synStatement">++</span> hanoiMover using source dest (n<span class="synStatement">-</span><span class="synConstant">1</span>)</pre>
</div>
</div>
</blockquote>
<p>This version is essentially a higher-order functional composition of my original hanoi.hs mentioned at the beginning of this blog post.</p>
<p>Thanks to augustss for pointing out this observation; I&#8217;ll try to write my functions in a more functional style hereinafter.</p>
<p>P.P.S.</p>
<p>Another commentator, Jedai, has been generous enough to <a href="http://dekudekuplex.wordpress.ecom/2009/04/13/climbing-the-towers-of-hanoi-with-haskell-style-curry-from-a-monadic-container-while-sparing-the-sugar/#comment-57">indicate</a> that my version of hanoi can be rewritten entirely without parentheses.  Per Jedai&#8217;s suggestion, I have rewritten hanoi.hs as follows:</p>
<blockquote>
<pre class="syntax-highlight"><span class="synComment">-- hanoiHelperRichSansParens.hs</span>
<span class="synComment">-- Haskell function to compute the Towers of Hanoi problem recursively, </span>
<span class="synComment">-- using a helper function and the '$' operator to take a function and </span>
<span class="synComment">-- an argument, and accordingly save typing parentheses, rewritten</span>
<span class="synComment">-- without parentheses</span>
<span class="synComment">-- </span>
<span class="synComment">-- Originally based on hanoiHelperRich.hs, a Haskell function to compute</span>
<span class="synComment">-- the Towers of Hanoi problem recursively, by Benjamin L. Russell,</span>
<span class="synComment">-- dated April 13, 2009, at 20:13; </span>
<span class="synComment">-- revised based on a comment from Jedai, dated April 18, 2009, at</span>
<span class="synComment">-- 03:21, (see http://dekudekuplex.wordpress.com/2009/04/13/climbing-the-towers-of-hanoi-with-haskell-style-curry-from-a-monadic-container-while-sparing-the-sugar/#comment-57),</span>
<span class="synComment">-- in response to my blog post "Climbing the Towers of Hanoi with</span>
<span class="synComment">-- Haskell-style Curry from a Monadic Container (While Sparing the </span>
<span class="synComment">-- Sugar!)," dated April 13, 2009, at 19:59 (see</span>
<span class="synComment">-- http://dekudekuplex.wordpress.com/2009/04/13/climbing-the-towers-of-hanoi-with-haskell-style-curry-from-a-monadic-container-while-sparing-the-sugar/)</span>
<span class="synComment">--</span>
<span class="synComment">-- Copyright(C) April 20, 2009, at 19:25, </span>
<span class="synComment">-- by Benjamin L. Russell</span>
<span class="synComment">-- </span>
<span class="synComment">-- This program is free software; you can redistribute it and/or modify</span>
<span class="synComment">-- it under the terms of the GNU General Public License as published by</span>
<span class="synComment">-- the Free Software Foundation; either version 2 of the License, or</span>
<span class="synComment">-- (at your option) any later version.</span>
<span class="synComment">--</span>
<span class="synComment">-- This program is distributed in the hope that it will be useful,</span>
<span class="synComment">-- but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span class="synComment">-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<span class="synComment">-- GNU General Public License for more details.</span>
<span class="synComment">--</span>
<span class="synComment">-- You should have received a copy of the GNU General Public License</span>
<span class="synComment">-- along with this program; if not, write to the Free Software</span>
<span class="synComment">-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span>

hanoi <span class="synStatement">::</span> Integer <span class="synStatement">-&gt;</span> IO ()
hanoi n <span class="synStatement">=</span> hanoiHelper n <span class="synConstant">"A"</span> <span class="synConstant">"B"</span> <span class="synConstant">"C"</span>

hanoiHelper <span class="synStatement">::</span> Integer <span class="synStatement">-&gt;</span> String <span class="synStatement">-&gt;</span> String <span class="synStatement">-&gt;</span> String <span class="synStatement">-&gt;</span> IO ()
hanoiHelper n source dest using
                <span class="synStatement">|</span> n <span class="synStatement">==</span> <span class="synConstant">1</span> <span class="synStatement">=</span> putStrLn <span class="synStatement">$</span> <span class="synConstant">"Move disc from "</span> <span class="synStatement">++</span> source <span class="synStatement">++</span> <span class="synConstant">" to "</span> <span class="synStatement">++</span> dest <span class="synStatement">++</span> <span class="synConstant">"."</span>
                <span class="synStatement">|</span> otherwise <span class="synStatement">=</span> hanoiHelper (n<span class="synStatement">-</span><span class="synConstant">1</span>) source using dest
                                      <span class="synStatement">&gt;&gt;</span> hanoiHelper <span class="synConstant">1</span> source dest using
                                           <span class="synStatement">&gt;&gt;</span> hanoiHelper (n<span class="synStatement">-</span><span class="synConstant">1</span>) using dest source</pre>
</blockquote>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dekudekuplex.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dekudekuplex.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dekudekuplex.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dekudekuplex.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dekudekuplex.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dekudekuplex.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dekudekuplex.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dekudekuplex.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dekudekuplex.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dekudekuplex.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=184&subd=dekudekuplex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dekudekuplex.wordpress.com/2009/04/13/climbing-the-towers-of-hanoi-with-haskell-style-curry-from-a-monadic-container-while-sparing-the-sugar/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a5af05af2cafbe739659871b86a07820?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Benjamin L. Russell</media:title>
		</media:content>
	</item>
		<item>
		<title>A Correction to &#8220;Too Much is Not Enough: The Revised^6 Report on the Algorithmic Language Scheme (R6RS)&#8221;</title>
		<link>http://dekudekuplex.wordpress.com/2009/03/26/a-correction-to-too-much-is-not-enough-the-revised6-report-on-the-algorithmic-language-scheme-r6rs/</link>
		<comments>http://dekudekuplex.wordpress.com/2009/03/26/a-correction-to-too-much-is-not-enough-the-revised6-report-on-the-algorithmic-language-scheme-r6rs/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 13:20:09 +0000</pubDate>
		<dc:creator>Benjamin L. Russell</dc:creator>
				<category><![CDATA[Programming Language Theory]]></category>
		<category><![CDATA[Scheme]]></category>

		<guid isPermaLink="false">http://dekudekuplex.wordpress.com/?p=144</guid>
		<description><![CDATA[In my previous blog entry, I had listed Jacob Matthews and Robert Bruce Findler as having been on the list of authors for the Revised^6 Report on the Algorithmic Language Scheme, but last month, Robby Findler pointed out in a comment that neither of these two authors had been responsible for decision-making; rather, they had [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=144&subd=dekudekuplex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In my previous blog entry, I had listed Jacob Matthews and Robert Bruce Findler as having been on the list of authors for the <a title="Revised^6 Report on the Algorithmic Language Scheme" href="http://www.r6rs.org/final/html/r6rs/r6rs.html">Revised^6 Report on the Algorithmic Language Scheme</a>, but last month, Robby Findler pointed out in a <a href="http://dekudekuplex.wordpress.com/2009/02/26/too-much-is-not-enough-the-revised6-report-on-the-algorithmic-language-scheme/#comment-28">comment</a> that neither of these two authors had been responsible for decision-making; rather, they had only been authors of the formal semantics thereof.</p>
<p>Therefore, I am removing them from the list of people responsible for decision-making for R6RS.</p>
<p>My apologies for the late correction.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dekudekuplex.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dekudekuplex.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dekudekuplex.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dekudekuplex.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dekudekuplex.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dekudekuplex.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dekudekuplex.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dekudekuplex.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dekudekuplex.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dekudekuplex.wordpress.com/144/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=144&subd=dekudekuplex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dekudekuplex.wordpress.com/2009/03/26/a-correction-to-too-much-is-not-enough-the-revised6-report-on-the-algorithmic-language-scheme-r6rs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a5af05af2cafbe739659871b86a07820?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Benjamin L. Russell</media:title>
		</media:content>
	</item>
		<item>
		<title>Too Much is Not Enough: The Revised^6 Report on the Algorithmic Language Scheme (R6RS)</title>
		<link>http://dekudekuplex.wordpress.com/2009/02/26/too-much-is-not-enough-the-revised6-report-on-the-algorithmic-language-scheme/</link>
		<comments>http://dekudekuplex.wordpress.com/2009/02/26/too-much-is-not-enough-the-revised6-report-on-the-algorithmic-language-scheme/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 12:00:18 +0000</pubDate>
		<dc:creator>Benjamin L. Russell</dc:creator>
				<category><![CDATA[Programming Language Theory]]></category>
		<category><![CDATA[Scheme]]></category>

		<guid isPermaLink="false">http://dekudekuplex.wordpress.com/?p=135</guid>
		<description><![CDATA[On September 26, 2007, the Revised^6 Report on the Algorithmic Language Scheme was released.  Normally, a new standard for Scheme is greeted with applause, but this time, the revision sparked a great controversy.  The Scheme community became divided between pro-R6RS and anti-R6Rs factions, and some members even decided to leave programming language theory [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=135&subd=dekudekuplex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>On September 26, 2007, the <a title="Revised^6 Report on the Algorithmic Language Scheme" href="http://www.r6rs.org/final/html/r6rs/r6rs.html">Revised^6 Report on the Algorithmic Language Scheme</a> was released.  Normally, a new standard for Scheme is greeted with applause, but this time, the revision sparked a great controversy.  The Scheme community became divided between pro-R6RS and anti-R6Rs factions, and some members even decided to leave programming language theory completely at least partly because of this change.  As Nils M. Holm has <a title="mentioned" href="http://www.t3x.org/sketchy/vol1/sl00.html">mentioned</a>,</p>
<blockquote><p>A lot has happened since the release of the previous edition of <strong>Sketchy LISP</strong>. The <q>Six&#8217;th Revised Report on the Algorithmic Language Scheme</q> (R<sup>6</sup>RS) was ratified and Scheme is no longer the language it used to be.</p></blockquote>
<p>Why not?  Consider this <a title="graph" href="http://www.wisdomandwonder.com/article/1927/a-scheme-timeline">graph</a> provided by Grant Rettke.  Looking at the graph, it is remarkable how there is a sudden break in continuity between most of the members of the list of authors for R2RS &#8211; R5RS, and those for R6RS.  Specifically, the following authors were in common between R2RS &#8211; R5RS, but suddenly disappeared in R6RS:</p>
<blockquote><p>Chris Hanson<br />
Chris Haynes<br />
Dan Friedman<br />
David Bartley<br />
Don Oxley<br />
Eugene Kohlbecker<br />
Gary Brooks<br />
Hal Abelson<br />
Jonathan Rees<br />
Kent Pitman<br />
Mitchell Wand<br />
Norman Adams (or Norman I Adams IV, assuming this name references the same author)<br />
Robert Halstead<br />
William Clinger</p></blockquote>
<p>Instead, we suddenly see the appearance of the following authors for R6RS, who had never appeared in any of R2RS &#8211; R5RS:</p>
<blockquote><p>Anton Van Straaten<br />
Jacob Matthews<br />
Matthew Flatt<br />
Michael Sperber<br />
Robert Bruce Findler</p></blockquote>
<p>In fact, the only person common in the lists between R3RS &#8211; R5RS (according to the chart, he was not an author for R2RS) and R6RS is Kent Dybvig.</p>
<p>What happened to all the previous authors, and who are these new authors?</p>
<p>Apparently, at least some of the previous authors quit the board, possibly because of a disagreement over the new standard.  As for the new authors, I know of both Matthew Flatt and Robert Bruce Findler from PLT Scheme.  They are members of the PLT Research Group, and they regularly post on the plt-scheme mailing list.  (They have both been very helpful on many occasions, so I have no qualms against them personally; I am just trying to analyze their motivations for R6RS.)  They are both also among the authors for HtDP.  They are also among the co-authors for the influential paper &#8220;<a title="The" href="http://http://www.ccs.neu.edu/scheme/pubs/jfp2004-fffk.pdf">The Structure and Interpretation of the Computer Science Curriculum</a>.&#8221;  According to that paper (see pp. 6-7, in section &#8220;3.1 Functional and object-oriented programming&#8221;), they write as follows:</p>
<blockquote><p>Functional programming and object-oriented programming differ with respect to<br />
the syntax and semantics of the underlying languages. The core of a functional lan-<br />
guage is small. All a beginning programmer needs are function definition, function<br />
application, variables, constants, a conditional form, and possibly a construct for<br />
defining algebraic types. In contrast, using an object-oriented language for the same<br />
purposes requires classes, fields, methods, inheritance in addition to everything that<br />
a functional language needs&#8230;.</p>
<p>Using a functional language followed by object-oriented language is thus the<br />
natural choice. The functional language allows students to gain confidence with<br />
program design principles. They learn to think about values and operations on<br />
values. They can easily comprehend how the functions and operations work with<br />
values. Better still, they can use the same rules to figure out why a program pro-<br />
duces the wrong values, which it often will. Teaching an object-oriented language<br />
in the second course is then a small shift of focus&#8230;.</p></blockquote>
<p>I.e., Flatt and Findler believe that teaching functional programming should be followed by teaching object-oriented programming.  This concept, however, is not shared by all educators.  In particular, Paul Hudak, one of the designers of the Haskell programming language, writes on the Haskell-Cafe mailing list as follows on a related issue (see &#8220;<a title="[Haskell-cafe] a regressive view of support for imperative programming in Haskell" href="http://www.haskell.org/pipermail/haskell-cafe/2007-August/030178.html">[Haskell-cafe] a regressive view of support for imperative programming in Haskell</a>&#8220;:</p>
<blockquote><p>All of the recent talk of support for imperative programming in Haskell<br />
makes me really nervous.  To be honest, I&#8217;ve always been a bit<br />
uncomfortable even with monad syntax.  Instead of:</p>
<p>do x &lt;- cmd1<br />
y &lt;- cmd2<br />
&#8230;<br />
return e</p>
<p>I was always perfectly happy with:</p>
<p>cmd1 &gt;&gt;= \x-&gt;<br />
cmd2 &gt;&gt;= \y-&gt;<br />
&#8230;<br />
return e</p>
<p>Functions are in my comfort zone; syntax that hides them takes me out of<br />
my comfort zone.</p>
<p>In my opinion one of the key principles in the design of Haskell has<br />
been the insistence on purity.  It is arguably what led the Haskell<br />
designers to &#8220;discover&#8221; the monadic solution to IO, and is more<br />
generally what inspired many researchers to &#8220;discover&#8221; purely functional<br />
solutions to many seemingly imperative problems.  With references and<br />
mutable data structures and IO and who-knows-what-else to support the<br />
Imperative Way, this discovery process becomes stunted.</p>
<p>Well, you could argue, monad syntax is what really made Haskell become<br />
more accepted by the masses, and you may be right (although perhaps<br />
Simon&#8217;s extraordinary performance at OSCOM is more of what we need).  On<br />
the other hand, if we give imperative programmers the tools to do all<br />
the things they are used to doing in C++, then we will be depriving them<br />
of the joys of programming in the Functional Way.  How many times have<br />
we seen responses to newbie posts along the lines of, &#8220;That&#8217;s how you&#8217;d<br />
do it in C++, but in Haskell here&#8217;s a better way&#8230;&#8221;.</p></blockquote>
<p>While Hudak contrasts imperative vs. functional, as opposed to object-oriented vs. functional, the basic issue is the same:  Should functional programming be treated as a separate paradigm by itself (as &#8220;the Functional Way&#8221; vs. &#8220;the Imperative Way&#8221; (or maybe even &#8220;the Object-oriented Way&#8221;)), or should it be combined with a different paradigm (be it imperative or object-oriented, the issue is the same).  Or even (according to some educators), should there even be an issue of &#8220;paradigm&#8221; at all?</p>
<p>This is an issue of basic teaching philosophy.  As an example of the third viewpoint, Shriram Krishnamurthi writes on the plt-scheme mailing list as follows (see &#8220;<a title="[plt-scheme] Re: More pedagogic stuff" href="http://list.cs.brown.edu/pipermail/plt-scheme/2008-August/026424.html">[plt-scheme] Re: More pedagogic stuff</a>&#8220;:</p>
<blockquote><p>Besides the simplistic<br />
reasoning, I am opposed to the whole idea of programming languages (or<br />
even much of programming) being organized around &#8220;paradigms&#8221;.  Here is<br />
a short and intentionally somewhat provocative article that I recently<br />
wrote about this:</p>
<p><a title="http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-teach-pl-post-linnaean/" href="http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-teach-pl-post-linnaean/">http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-teach-pl-post-linnaean/</a></p></blockquote>
<p>In the referenced page, Krishnamurthi writes as follows:</p>
<blockquote><p>Programming language &#8220;paradigms&#8221; are a moribund and tedious legacy of a<br />
bygone age. Modern language designers pay them no respect, so why do our courses<br />
slavishly adhere to them? This paper argues that we should abandon this method of<br />
teaching languages, offers an alternative, reconciles an important split in programming<br />
language education, and describes a textbook that explores these matters.</p></blockquote>
<p>In the referenced paper (see &#8220;<a title="Teaching Programming Languages in a Post-Linnaean Age" href="http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-teach-pl-post-linnaean/paper.pdf">Teaching Programming Languages in a Post-Linnaean Age</a>,&#8221; Krishnamurthi writes (see p. 1, third paragraph):</p>
<blockquote><p>Most books<br />
rigorously adhere to the sacred division of languages into “functional”, “imperative”, “object-oriented”,<br />
and “logic” camps. I conjecture that this desire for taxonomy is an artifact of our science-envy from the<br />
early days of our discipline: a misguided attempt to follow the practice of science rather than its spirit.<br />
We are, however, a science of the artificial. What else to make of a language like Python, Ruby, or Perl?<br />
Their designers have no patience for the niceties of these Linnaean hierarchies; they borrow features as they<br />
wish, creating melanges that utterly defy characterization.</p></blockquote>
<p>Ultimately, it seems that this issue boils down to a matter of taste.</p>
<p>This is usually not a problem, so long as this taste is confined to a particular implementation.  The problem with R6RS is that it is not just an implementation; it is a standard that can affect all implementations.  R6RS, compared to previous revisions, makes a dramatic number of changes to the Scheme standard.  Each one, individually, is not such a big problem; it is the entirety of all these changes taken together without sufficient discussion that is the problem.</p>
<p>The members of the board had to vote for all the changes taken together, rather than each one separately.  A standard usually should require a consensus; however, this consensus was not really achieved in the case of R6RS (read through the reasoning behind both the &#8220;yes&#8221; and &#8220;no&#8221; votes in the &#8220;<a title="R6RS Ratification Vote" href="http://www.r6rs.org/ratification/results.html">R6RS Ratification Vote</a>,&#8221; and you will see the scope of the division).</p>
<p>Some of the main points of this division seem to be the following (apologies to those whose votes are not listed below; I have listed only the votes of names that sounded familiar to me, but there were many other significant votes, which were omitted not because of lack of significance, but because of lack of space and time):</p>
<blockquote><p>the module system (see votes by <a title="Chris Hanson" href="http://www.r6rs.org/ratification/results.html#X78">Chris Hanson</a> and <a title="Taylor R Campbell" href="http://www.r6rs.org/ratification/results.html#X100">Taylor R Campbell</a>)</p>
<p>SYNTAX-CASE (see the vote by <a title="Chris Hanson" href="http://www.r6rs.org/ratification/results.html#X78">Chris Hanson</a> above)</p>
<p>the switch to case sensitivity (see the vote by <a title="Jonathan Rees" href="http://www.r6rs.org/ratification/results.html#X91">Jonathan Rees</a>)</p>
<p>defining too many features as part of the language, rather than on top of the language (see the vote by <a title="Nils M Holm" href="http://www.r6rs.org/ratification/results.html#X94">Nils M Holm</a>)</p>
<p>lack of time to change the draft to meet the deadline of the ratification draft (see the vote by <a title="Shiro Kawai" href="http://www.r6rs.org/ratification/results.html#X99">Shiro Kawai</a>)</p>
<p>too long description of the specification (thrice the previous one); restrictions on implementation design that impede future development of the language in the areas of numbers, text manipulation &amp; Unicode, and the module system; overreach of the module system&#8217;s definition (see the vote by <a title="Taylor R Campbell" href="http://www.r6rs.org/ratification/results.html#X100">Taylor R Campbell</a>)</p></blockquote>
<p>Even some of the &#8220;yes&#8221; votes list &#8220;imperfections&#8221; that &#8220;troubled&#8221; them:</p>
<blockquote><p>apparent inflexibility of the library system, and absence of a facility analagous to Common Lisp&#8217;s reader macros (see the vote by <a title="Alexey Radul" href="http://www.r6rs.org/ratification/results.html#X2">Alexey Radul</a>)</p></blockquote>
<p>In sum, it seems that R6RS was at least partly motivated by a perceived need by at least some of the new authors for a standard of Scheme that would help ease the transition between the functional and object-oriented paradigms.  Apparently, at least some of the authors perceived that adding more features to the core language, instead of defining a small core language and adding features on top of the language, would help with this transition.</p>
<p>Another problem was lack of time.  R6RS seems rather rushed compared to previous specifications.  There probably should have been more discussion before finalizing the specification.  In particular, there should have been some means of voting on each potential feature separately, instead of on all of them together.  It is quite possible for each feature alone to be quite useful, but for the combination of all of them put together suddenly at once to be quite problematic.</p>
<p>(This entry an adaptation of my post &#8220;<a title="Re: History of Scheme People" href="http://groups.google.com/group/comp.lang.scheme/msg/55533b19c42278c8?">Re: History of Scheme People</a>,&#8221; dated &#8220;Thu, 26 Feb 2009 15:45:33 +0900,&#8221; on the USENET newsgroup <a title="comp.lang.scheme" href="http://groups.google.com/group/comp.lang.scheme/topics">comp.lang.scheme</a>.)</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dekudekuplex.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dekudekuplex.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dekudekuplex.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dekudekuplex.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dekudekuplex.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dekudekuplex.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dekudekuplex.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dekudekuplex.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dekudekuplex.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dekudekuplex.wordpress.com/135/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=135&subd=dekudekuplex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dekudekuplex.wordpress.com/2009/02/26/too-much-is-not-enough-the-revised6-report-on-the-algorithmic-language-scheme/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a5af05af2cafbe739659871b86a07820?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Benjamin L. Russell</media:title>
		</media:content>
	</item>
		<item>
		<title>Motivating Category Theory for Haskell for Non-mathematicians</title>
		<link>http://dekudekuplex.wordpress.com/2009/01/19/motivating-learning-category-theory-for-non-mathematicians/</link>
		<comments>http://dekudekuplex.wordpress.com/2009/01/19/motivating-learning-category-theory-for-non-mathematicians/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 11:50:48 +0000</pubDate>
		<dc:creator>Benjamin L. Russell</dc:creator>
				<category><![CDATA[Category Theory]]></category>
		<category><![CDATA[Haskell]]></category>

		<guid isPermaLink="false">http://dekudekuplex.wordpress.com/?p=96</guid>
		<description><![CDATA[The Issue:  Why Study Category Theory?

Two days ago, there was another interesting post by Andrzej Jaworski, entitled “[Haskell-cafe] Mathematics for Uninterested,” dated “Sat, 17 Jan 2009 05:15:25 +0100,” on the Haskell-cafe mailing list on the Haskell programming language, offering an explanation of why mathematics is important for learning Haskell.  In particular, he wrote:
MATHEMATICS_IS_ABOUT_SIMPLIFYING_THINGS.
MATHEMATICS = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=96&subd=dekudekuplex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>The Issue:  Why Study Category Theory?<br />
</strong></p>
<p>Two days ago, there was another interesting <a title="post" href="http://www.haskell.org/pipermail/haskell-cafe/2009-January/053800.html">post</a> by Andrzej Jaworski, entitled “[Haskell-cafe] Mathematics for Uninterested,” dated “Sat, 17 Jan 2009 05:15:25 +0100,” on the <a title="Haskell-cafe mailing list" href="http://www.haskell.org/pipermail/haskell-cafe/">Haskell-cafe mailing list</a> on the Haskell programming language, offering an explanation of why mathematics is important for learning Haskell.  In particular, he wrote:</p>
<blockquote><p>MATHEMATICS_IS_ABOUT_SIMPLIFYING_THINGS.</p>
<p>MATHEMATICS = MATHEMATICAL_KNOWLEDGE + FORMAL_METHODS_of_THINKING</p>
<p>You need only the second part for Haskell.</p></blockquote>
<p>He then continued:</p>
<blockquote><p>&#8230; Category Theory generalizes our mathematical experience along the line that we know<br />
more that we can prove.</p></blockquote>
<p>Nevertheless, many non-mathematicians continue to have much difficulty in motivating study of category theory.  Some regard it as too theoretical.  Others regard it as too abstract.  And still others regard it as too dry.</p>
<p>While I cannot argue too much against the second point (indeed, category theory has been nicknamed &#8220;<a title="abstract nonsense" href="http://en.wikipedia.org/wiki/Abstract_nonsense">abstract nonsense</a>,&#8221; although not necessarily pejoratively), and cannot truly deny the first for those who do not prefer theory, I have something to say from personal experience, as a student who overcame math phobia to appreciate beauty in mathematics, about the third.</p>
<p>Each student learns differently.  Some learn best by seeing examples.  Some learn best by studying theory.  Still others learn best by actually solving problems.</p>
<p><strong>Case Study:  My Personal Experience in Approaching Mathematics</strong></p>
<p>Several years ago, when I was still living in Manhattan, I read an article in a local newsletter about how different students had different learning styles in primary (and possibly secondary) school, and how putting different students into the wrong type of class inhibited their learning.  In particular, the article discussed how most students in the classes could be grouped into either of two different learning styles:  those who learned by example, and those who learned by theory.  Students who learned by example needed to see concrete examples of the mathematics in action in order to infer the reasoning; conversely, students who learned by theory learned best by studying the general theory from which to deduce specific applications.  Neither style was correct; they were simply different, and suited different types of students.</p>
<p>The same can probably be said for learning category theory.  Personally, I learn best from a combination of first studying theory, and actually applying the theory to incrementally more sophisticated problems.  Without the theory, I cannot understand the examples, but without actually applying the theory, I tend to forget about it very quickly.  Applying the theory, especially in a creative manner, makes it stick in my brain.</p>
<p>However, although I eventually was able to major in computer science, getting there was a long, arduous, grueling odyssey.  The most difficult part was conquering a required course in the design and analysis of algorithms.  I had come to college from a self-educated background, studying on my own since fifth grade in elementary school without any teacher, using only books, because of family circumstances.  In the end, I wound up studying throughout my secondary school years at home.</p>
<p>However, my interests had been in writing and multimedia applications.  As a result, prior to coming to college, while I had had extensive practice in writing, I had had minimal exposure to mathematics.  My first exposure to college-level mathematics resulted in an outbreak of math phobia.</p>
<p>Nevertheless, I still wished to study something related to computers in college.  Because the school happened to be a research-oriented school with a theoretically-oriented faculty, the only computer-related topic available happened to be computer science, and the focus was on theory.</p>
<p>Theoretical computer science happens to have a heavy focus on mathematics.  However, I happened to be struggling with math phobia.  I needed to find something interesting about mathematics if I was to remain in computer science.</p>
<p>Fortunately, one very generous mathematics student offered to tutor me <em>gratis </em>once per week over one summer.  He gave me what he termed &#8220;an elementary course from an advanced viewpoint.&#8221;  He started out from axiomatic set theory, focusing on lemmas and proofs of theorems, and gave me an intuitive grasp of such elementary concepts as set comprehension, power sets, ordered pairs, and Cartesian products.  I later learned about Russell&#8217;s paradox, and found it rather interesting.  At the end of the summer, I was able to take and pass an undergraduate course at my college in axiomatic set theory.  Then I discovered <em><a title="an Eternal Golden Braid" href="http://www.amazon.com/Godel-Escher-Bach-Eternal-Golden/dp/0465026567">Gödel, Escher, Bach: an Eternal Golden Braid</a></em>, was fascinated, and the next semester, I proceeded on to pass recursive function theory.  Then I took a course in automata theory.  Then I took a course (albeit in the philosophy department) in meta-logic.  Then I took a graduate-level course in recursion equations (domain theory).</p>
<p>After then taking a year&#8217;s leave of absence to study discrete mathematics for computer science outside of my official curriculum, I was able to return and eventually pass the required course in the design and analysis of algorithms.  The next semester, I then took an additional course in advanced algorithms, which turned out to be significantly less of a hassle than the first course in algorithms (the exercises were more abstract, but the workload was considerably less, so I went to the library and did some research for each problem set).  One of my favorite courses later wound up being one in formal semantics of programming languages, where I was exposed to this fascinating creature, the lambda calculus.</p>
<p>Yet somehow along the way &#8230; I forgot how to program well.  I had to struggle through another required course in systems programming in C, and this time <em>acquired </em>programming phobia, which I had not had before.  Oh dear, I had forgotten how to use pointers in coding linked lists!  I only recovered after auding a course using Scheme to teach computer science under a professor who also taught Haskell.  Then I audited another course under this professor in Haskell.  Thank goodness!  No more pointers, no more memory management!  Instead, higher-order functions!</p>
<p><strong>A Short, Thin, Elementary, Yet Influential Book and Its Approach</strong></p>
<p>One of the most influential books in my struggle to conquer algorithms was a most unassuming, very thin, informal book called <em><a title="Naive Set Theory" href="http://www.amazon.com/Naive-Theory-Undergraduate-Texts-Mathematics/dp/0387900926">Naive Set Theory</a></em>, by Paul R. Halmos.  This book had no explicit exercises marked as such, and the treatment was almost conversational in tone, yet almost every sentence was an implicit exercise in abstract thinking.  Each chapter was only three to five pages long, with almost no equations, and the entire book was only about a hundred pages long.  The covers together were barely thicker combined than the text.  Yet it still covered the following topics:</p>
<blockquote><p>the Axiom of Extension<br />
the Axiom of Specification<br />
unordered pairs<br />
unions and intersections<br />
complements and powers<br />
unordered pairs<br />
relations<br />
functions<br />
families<br />
inverses and composites<br />
numbers<br />
the Peano Axioms<br />
arithmetic<br />
order<br />
the Axiom of Choice<br />
Zorn&#8217;s Lemma<br />
well ordering<br />
transfinite recursion<br />
ordinal numbers<br />
sets of ordinal numbers<br />
ordinal arithmetic<br />
the Schröder-Bernstein Theorem<br />
countable sets<br />
cardinal arithmetic<br />
cardinal numbers</p></blockquote>
<p>Imagine covering an entire topic in mathematics with almost no equations, and no explict exercises, and only three to five pages per chapter!  This was easily one of the shortest books I ever read in college, yet one of the most influential: Not only did it resolve the math phobia, but it also imbued me with an appreciation for elegant proofs, and hence for beauty in mathematics.</p>
<p><strong>A Related Topic:  Computability Theory<br />
</strong></p>
<p>Another experience that helped in my endeavor was an independent seminar with one researcher in automata theory (it was actually this experience which eventually led to my auditing a course in this subject).  My employer for one summer was a programmer who had graduated from the same university.  He helped me set up an independent once-a-week seminar (actually a private tutorial) covering the book <em><a title="Elements of the Theory of Computation" href="http://www.amazon.com/Elements-Theory-Computation-Prentice-Hall-Software/dp/0132734176/ref=ed_oe_h">Elements of the Theory of Computation</a></em> (first hardcover edition), by  Harry R. Lewis and <span> Christopher Papadimitriou.  I would read the book, collect questions, and bring them to the seminar every week.  This book covered such topics as computability, the diagonalization lemma, unsolvability, finite state automata, Turing machines, mathematical logic, and other related topics.  What I liked about this book was the aspect that, although it gave a very formal, abstract treatment to computability theory, otherwise it did not assume any specific knowledge of any area of mathematics.<br />
</span></p>
<p>I think that a book similar to the above two for category theory would be highly useful, at least for students with the same learning pattern as myself.  For such students, I believe that what is most important is the intuition; the formalism can come later.  Mathematics is not about formalism; it is about insight: insight into patterns and structure, and the beauty that comes with such patterns.  While a book with many exercises would probably be necessary at some point, for a first course in category theory for a non-mathematician, an approach similar to <a title="Halmos'" href="http://en.wikipedia.org/wiki/Naive_Set_Theory_(book)">Halmos&#8217;</a> would seem most effective.</p>
<p><strong>Set Theory vs. Category Theory:  The Conflict in Approach</strong></p>
<p>The only problem with recommending a book on set theory to a student of category theory is that the approaches do not overlap.  Set theory studies what is inside sets; category theory studies what is outside them.</p>
<p>Specifically, set theory starts out by defining the empty set, then defining basic axioms, and then defining certain operations on sets and functions operating on sets in leading up to lemmas and theorems about properties of sets.  However, the focus is essentially on what is inside the sets.</p>
<p>However, category theory ignores what is inside, and instead focuses on structure-preserving mappings (known as &#8220;homomorphisms&#8221;) between different sets having a specific structure.  These homomorphisms lead to theorems about the structure of the sets.  Thus, it is these mappings in category theory that are the focus, not explicitly what is inside the sets.  This is the origin of the nickname of &#8220;abstract nonsense&#8221; in reference to category theory.</p>
<p>Therefore, there is a risk that exposing a new student of Haskell first to set theory could actually confuse the student upon subsequent exposure to category theory.  Therefore, I might substitute instead an elementary introduction to category theory with an informal, somewhat conversational tone, such as the following:</p>
<p><em><a title="A First Introduction to Categories" href="http://www.amazon.com/Conceptual-Mathematics-First-Introduction-Categories/dp/0521478170">Conceptual Mathematics: A First Introduction to Categories</a></em><br />
by F. William Lawvere and Stephen Hoel Schanuel<br />
Cambridge: Cambridge University Press, 1997<br />
As discussed in my blog entry &#8220;<a title="Like Flatterland, Only About Categories" href="http://dekudekuplex.wordpress.com/2009/01/16/learning-haskell-through-category-theory-and-adventuring-in-category-land-like-flatterland-only-about-categories/">Learning Haskell through Category Theory, and Adventuring in Category Land: Like Flatterland, Only About Categories</a>,&#8221;this is an elementary introduction to category theory, with a conversational tone, using such examples as Galileo and the flight of a bird for illustration.</p>
<p><strong>Advanced Topics for Further Study<br />
</strong></p>
<p>Once the student has had a taste of category theory, there are two possible alternatives:  Either broaden the topics, or deepen them.  The latter has already been discussed in my above-mentioned blog post &#8220;<a title="Like Flatterland, Only About Categories" href="http://dekudekuplex.wordpress.com/2009/01/16/learning-haskell-through-category-theory-and-adventuring-in-category-land-like-flatterland-only-about-categories/">Learning Haskell through Category Theory, and Adventuring in Category Land: Like Flatterland, Only About Categories</a>&#8220;; here I discuss the former.</p>
<p>As mentioned above, <strong>automata theory</strong> is one possibility for advanced study for students who have acquired a taste for theory and wish to explore more:</p>
<p><em><a title="Elements of the Theory of Computation" href="http://www.amazon.com/Elements-Theory-Computation-Prentice-Hall-Software/dp/0132734176/ref=ed_oe_h">Elements of the Theory of Computation</a></em> (first hardcover edition)<br />
by Harry R. Lewis and Christopher Papadimitriou<br />
New Jersey: Prentice Hall, Inc., June 1981<br />
As discussed above, a formal, rigorous treatment of the theory of computation.  The book assumes the ability to reason abstractly, but does not assume familiarity with any specific areas of mathematics.  Most readers either love or hate this book, depending on whether they are theoretically-inclined.</p>
<p>Another possibility is <strong>recursive function theory</strong>:</p>
<p><em><a title="Fundamentals of Theoretical Computer Science (Computer Science and Scientific Computing)" href="http://www.amazon.com/Computability-Complexity-Languages-Second-Fundamentals/dp/0122063821">Computability, Complexity, and Languages, Second Edition: Fundamentals of Theoretical Computer Science (Computer Science and Scientific Computing)</a></em><br />
by Martin Davis, Ron Sigal, and Elaine J. Weyuker<br />
San Francisco, California: Morgan Kaufmann Publishers, 1994<br />
This book, like <em><a title="Elements of the Theory of Computation" href="http://www.amazon.com/Elements-Theory-Computation-Prentice-Hall-Software/dp/0132734176/ref=ed_oe_h">Elements of the Theory of Computation</a></em>, is formal, but does not assume any specific background in mathematics.  One of the authors of this book, Ron Sigal, used to be my professor for set theory, recursive function theory, and recursion equations (domain theory) in college.  He was friendly and approachable, had an exceptionally clear teaching style, and usually spent the first class in an interesting lecture discussing the historical background of the subject.</p>
<p>Still another possibility is my nemesis, the <strong>design and analysis of algorithms</strong>:</p>
<p><em><a title="An Introduction to the Analysis of Algorithms (Principles of Computer Science Series)" href="http://www.amazon.com/Compared-What-Introduction-Algorithms-Principles/dp/071678243X">Compared to What?: An Introduction to the Analysis of Algorithms (Principles of Computer Science Series)</a></em><br />
by Gregory J.E. Rawlins<br />
New York: W. H. Freeman, November 15, 1991<br />
This was my favorite book on algorithms in college, and played an instrumental role in allowing me to pass this subject.  Without this book, I probably would have had a much more difficult time in clearing this subject.  This book approaches each algorithm from the perspective of how the algorithm is arrived at, rather than just handing the solution ready-made, interspersing numerous entertaining illustrations and quotes from works by Lewis Carroll.  I further wrapped this book in kaleidoscopic bookwrap to strengthen the feeling of being in algorithm wonderland while reading this book, and the effect worked like a charm:  I learned the algorithms, finally passed the course, and completed the major.</p>
<p><em><a title="Introduction to Algorithms, Second Edition" href="http://highered.mcgraw-hill.com/sites/0070131511/">Introduction to Algorithms, Second Edition</a></em><br />
by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein<br />
Cambridge, Massachusetts: The MIT Press, September 1, 2001<br />
This is the second edition of a classic work in the subject.  It provides a rigorous theoretical treatment of algorithms.  The first edition of this book forced the author of this blog to undertake a seemingly never-ending journey through set theory, discrete mathematics, recursive function theory, automata theory, meta-logic, and recursion equations (domain theory) in order to clear the topics covered by this book.  I haven&#8217;t read the second edition yet, but the first edition was very complete and thorough, and was basically a mathematical encyclopedia on algorithms, complete with a brief introduction to prerequisite topics, detailed development of proofs, numerous exercises that led to other parts of the main text, numerous starred exercises of special difficulty (my professor hired a student who did all the starred exercises on his problem sets as a summer research intern), detailed pseudocode, analysis of the pseudocode, proofs of the analysis of the pseudocode, and highly detailed illustrations covering details of the algorithms and their proofs.  Of course, this book has no solutions.  Hey, who needs solutions?  Nobody said you needed sleep, right?</p>
<p><em><a title="The Art of Computer Programming" href="http://www-cs-faculty.stanford.edu/~uno/taocp.html">The Art of Computer Programming</a></em> (currently, Volumes 1 to 3 and Fascicles 0 to 4 of Volume 4, with Volume 5 planned for release in 2015, and Volumes 6 and 7 planned for later release)<br />
by Donald E. Knuth<br />
Reading, Massachusetts: Addison-Wesley, 1997 to 2006 and pending<br />
The original classic work on the design and analysis of algorithms.  Still in progress.  Originally begun in 1962, written by compiler expert Donald E. Knuth.  Volume 1 covers fundamental algorithms, volume 2 covers seminumerical algorithms, volume 3 covers sorting and searching, volume 4 covers combinatorical algorithms, volume 5 is scheduled to cover syntactic algorithms, volume 6 is scheduled to cover the theory of context-free languages, and volume 7 is scheduled to cover compiler techniques.  Exercises range in difficulty from &#8220;warm-up&#8221; exercises to research problems.</p>
<p>One last topic is <strong>algebra</strong>, for which there is reputedly a very approachable work focusing on a limited scope of topics and exploring them to great depth:</p>
<p><em><a title="Topics in Algebra" href="http://www.amazon.com/Topics-Algebra-I-N-Herstein/dp/0471010901">Topics in Algebra</a></em><br />
by I. N. Herstein<br />
Xerox Corporation, 1975<br />
Although I haven&#8217;t read this book, it has earned very high reviews for exposition and flow.  The book is reputedly designed so that a few basic ideas are focused on, and problems in them explored, so that each new topic flows seemlessly from the previous one.</p>
<p><strong>Conclusion</strong></p>
<p>Let students take the book on the subway, train, or bus, and have them think about the categories in their sleep!  Gradually, their curiosity will be piqued, and they will understand categories.  Then they can read a second book with many exercises.  But while they still have curiosity, let them at least visualize and juggle the categories in many ways in their heads before forcing them off!  The more easily they can digest their first book, the more likely their curiosity will stay.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dekudekuplex.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dekudekuplex.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dekudekuplex.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dekudekuplex.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dekudekuplex.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dekudekuplex.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dekudekuplex.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dekudekuplex.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dekudekuplex.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dekudekuplex.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=96&subd=dekudekuplex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dekudekuplex.wordpress.com/2009/01/19/motivating-learning-category-theory-for-non-mathematicians/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a5af05af2cafbe739659871b86a07820?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Benjamin L. Russell</media:title>
		</media:content>
	</item>
		<item>
		<title>Learning Haskell through Category Theory, and Adventuring in Category Land:  Like Flatterland, Only About Categories</title>
		<link>http://dekudekuplex.wordpress.com/2009/01/16/learning-haskell-through-category-theory-and-adventuring-in-category-land-like-flatterland-only-about-categories/</link>
		<comments>http://dekudekuplex.wordpress.com/2009/01/16/learning-haskell-through-category-theory-and-adventuring-in-category-land-like-flatterland-only-about-categories/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 11:55:20 +0000</pubDate>
		<dc:creator>Benjamin L. Russell</dc:creator>
				<category><![CDATA[Category Theory]]></category>
		<category><![CDATA[Haskell]]></category>

		<guid isPermaLink="false">http://dekudekuplex.wordpress.com/?p=84</guid>
		<description><![CDATA[Two days ago, there was an interesting post by Andrzej Jaworski, entitled &#8220;[Haskell] Teach theory then Haskell as example,&#8221; dated “Wed, 14 Jan 2009 04:37:33 +0100,” on the Haskell mailing list on the Haskell programming language, recommending that Haskell be taught &#8220;on most abstract terms in a framework of higher order logic, types and CT [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=84&subd=dekudekuplex&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Two days ago, there was an interesting <a title="post" href="http://www.haskell.org/pipermail/haskell/2009-January/020929.html">post</a> by Andrzej Jaworski, entitled &#8220;[Haskell] Teach theory then Haskell as example,&#8221; dated “Wed, 14 Jan 2009 04:37:33 +0100,” on the <a title="Haskell mailing list" href="http://www.haskell.org/pipermail/haskell/">Haskell mailing list</a> on the <a title="Haskell" href="http://www.haskell.org/">Haskell</a> programming language, recommending that Haskell be taught &#8220;on most abstract terms in a framework of higher order logic, types and CT right from the start.&#8221;  While I agreed with the gist of his post, I hadn&#8217;t found an appropriate publication on category theory that addressed the subject at the proper pace, level, and perspective.  Most publications did not explain enough detail, assumed too many topics not covered, or did not explain the concepts in a manner which would allow me to form a visual framework of reference in my mind.  In my <a title="response" href="http://www.haskell.org/pipermail/haskell/2009-January/020933.html">response</a>, I listed the following publications on <a title="category theory" href="http://www.haskell.org/haskellwiki/Category_theory">category theory</a>, a branch of mathematics which forms a theoretical framework for Haskell.  (Author names and dates have been added, explicit URL&#8217;s replaced by hyperlinks in titles, and descriptions expanded, for referential convenience.  In addition, I have added one additional book entry for cross-referential purposes.):</p>
<blockquote><p><strong>Category Theory Books:</strong></p>
<p><em><a title="A First Introduction to Categories (Paperback)" href="http://www.amazon.com/Conceptual-Mathematics-First-Introduction-Categories/dp/0521478170">Conceptual Mathematics: A First Introduction to Categories (Paperback)</a></em><br />
by F. William Lawvere (author) and Stephen Hoel Schanuel (author)<br />
Cambridge: Cambridge University Press, 1997<br />
An elementary introduction to category theory</p>
<p><em><a title="An introduction to category theory in four easy movements" href="http://www.cs.man.ac.uk/~hsimmons/BOOKS/CatTheory.pdf">An introduction to category theory in four easy movements</a></em><br />
by A. Schalk (author) and H. Simmons (author)<br />
Manchester: A. Schalk and H. Simmons, October &#8211; December, 2005<br />
A somewhat informal, reportedly in-depth introduction to category theory, which some students have described as being intricately layered.  Personally, I like Harold Simmons style, because it seems to have more personality than that of many other authors on category theory.  Sometimes he is actually funny; e.g., he writes (see p. 6),</p>
<blockquote><p>&#8220;In the original examples of categories the arrows were morphisms which were then called homomorphism, and it wasn&#8217;t realized that this family could be very large.  (Some out and out category theorists still don&#8217;t realize the significance of this.  On the other hand, some off the wall set theorists don&#8217;t realize the significance of category theory.)&#8221;</p></blockquote>
<p>I&#8217;ve heard of the UNIX wars and the editor wars, but now we have the category theory vs. set theory wars!  The more some things change, the more they stay the same&#8230;.</p>
<p><em><a title="A short introduction to the basics of category theory" href="http://www.cs.man.ac.uk/~hsimmons/MAGIC-CATS/CourseNotes-Dec-01.pdf">Category Theory by Magic: A short introduction to the basics of category theory</a></em><br />
by Harold Simmons<br />
Manchester: Harold Simmons, November 29, 2008<br />
A somewhat more advanced text than <em>An introduction to category theory in four easy movements</em>, intended specifically for &#8220;postgraduate students,&#8221; but written in an exceptionally clear style.</p>
<p><em><a title="Toposes, Triples and Theories" href="http://www.cwru.edu/artsci/math/wells/pub/ttt.html">Toposes, Triples and Theories</a></em><br />
by Michael Barr and Charles Wells<br />
Michael Barr and Charles Wells, 2000<br />
An often-referenced introduction to category theory, intended for graduate students, reportedly<br />
discussing monads as &#8220;triples.&#8221;  This book is a sequel to <a title="Category Theory Lecture Notes for ESSLLI" href="http://www.math.upatras.gr/~cdrossos/Docs/B-W-LectureNotes.pdf"><em></em></a><em><a title="Category Theory for Computing Science" href="http://www.cwru.edu/artsci/math/wells/pub/ctcs.html">Category Theory for Computing Science</a></em>, by the same author. This is one of the publications listed in the bibliography by Simmons in <em><a title="A short introduction to the basics of category theory" href="http://www.cs.man.ac.uk/~hsimmons/MAGIC-CATS/CourseNotes-Dec-01.pdf">Category Theory by Magic: A short introduction to the basics of category theory</a></em>.</p>
<p><em><a title="Category Theory for Computing Science (Third Edition)" href="http://www.cwru.edu/artsci/math/wells/pub/ctcs.html">Category Theory for Computing Science (Third Edition)</a></em><br />
by Michael Barr and Charles Wells<br />
Hertfordshire, U.K.: Prentice Hall International (UK) Ltd., 1999<br />
Prequel to <em><a title="Toposes, Triples and Theories" href="http://www.cwru.edu/artsci/math/wells/pub/ttt.html">Toposes, Triples and Theories</a></em>, &#8220;written specifically to be read by researchers and students in   computing science.&#8221;    Apparently, only available in dead-tree format.  Can be <a title="ordered" href="http://crm.umontreal.ca/pub/Ventes/desc/PM023.html">ordered</a> from <a title="Centre de recherches mathématiques" href="http://crm.umontreal.ca/pub/Ventes/CatalogueEng.html">Centre de recherches mathématiques</a>, or by e-mail to crmbooks@crm.umontreal.ca.   Often cited in the literature.</p>
<p><em><a title="Categories and Computer Science" href="http://www.cambridge.org/us/catalogue/catalogue.asp?isbn=0521419972">Categories and Computer Science</a></em><br />
by R. F. C. Walters<br />
Cambridge: Cambridge University Press, August 1992<br />
Reportedly a straightforward introduction to category theory, with many examples from computer science</p>
<p><em>Arrow, Structures and Functors &#8211; The Categorical Imperative</em> (no hyperlink available)<br />
According to the HaskellWiki page on <a title="category theory" href="http://haskell.org/haskellwiki/Category_theory">category theory</a>, an out-of-print book covering monads and the Yoneda lemma, with very little prerequisite knowledge</p>
<p><em><a title="Category Theory" href="http://www.math.uchicago.edu/~may/VIGRE/VIGRE2009/Awodey.pdf">Category Theory</a></em><br />
by Steve Awodey<br />
Oxford: Oxford University Press, 2006<br />
This text aims to minimize mathematical prerequisites in providing an introduction to category theory for students in such topics as computer science, logic, linguistics, cognitive science, or philosophy, who may not necessarily be working (or aspiring) mathematicians.  Students are not assumed to have much background in mathematics beyond a course in discrete mathematics and some calculus or linear algebra or logic.</p>
<p>The book starts out with a few basic examples of posets and monoids, and then develops them in further detail.  While the book assumes little in mathematical prerequisites, it does not sacrifice rigor, and covers categories, functors, natural transformations, equivalence, limits and colimits, functor categories, representables, Yoneda’s lemma, adjoints, and monads.  Optional topics covered include cartesian closed categories and the lambda calculus.  However, 2-categories and monoidal categories are purposely excluded, and toposes are not covered in any depth.</p>
<p>Two aspects that I like about this book are the author&#8217;s style of starting out with examples from and references to set theory (although it is true that arrows, not objects, are the focus in category theory, many students come from a set-theoretical background, and references to set theory can ease the transition), and offering occasional examples from computer science.  For instance, Example 10 on page 11 provides a case in which a functional programming language L is given and an associated category is shown where the objects are the data types of L, the arrows are the computable functions of L (&#8220;processes,&#8221; &#8220;procedures,&#8221; and &#8220;programs&#8221;), the composition of two programs, f mapping X to Y, and g mapping Y to Z, &#8220;is given by applying g to the output of f,&#8221; and the identity is the &#8220;do nothing&#8221; program.  Such examples help tie the subject to computer science (in particular, to functional programming), and help render the subject more appealing to students of functional programming.</p>
<p><strong>Category Theory Lecture Notes:</strong></p>
<p><em><a title="Category Theory Lecture Notes for ESSLLI" href="http://www.math.upatras.gr/~cdrossos/Docs/B-W-LectureNotes.pdf">Category Theory Lecture Notes for ESSLLI</a></em><br />
by Michael Barr and Charles Wells<br />
Michael Barr and Charles Wells, 1999<br />
Condensed version of <em><a title="Category Theory for Computing Science" href="http://www.cwru.edu/artsci/math/wells/pub/ctcs.html">Category Theory for Computing Science</a>, </em>discussing category theory from a computer science perspective</p>
<p><em><a title="A Gentle Introduction to Category Theory - the calculational approach" href="http://wwwhome.cs.utwente.nl/~fokkinga/mmf92b.html">A Gentle Introduction to Category Theory &#8211; the calculational approach</a></em><br />
by Maarten M. Fokkinga<br />
Amsterdam: M. M. Fokkinga, 1992 (version of June 6, 1994)<br />
Another set of lecture notes referenced on the HaskellWiki page on category theory</p>
<p><strong>Categorical Programming with Examples in Haskell:</strong></p>
<p><em><a title="Categorical Programming with Inductive and Coinductive Types" href="http://www.cs.ut.ee/~varmo/papers/thesis.pdf">Categorical Programming with Inductive and Coinductive Types</a></em><br />
by Varmo Vene<br />
Tartu, Estonia: Varmo Vene, 2000 (Ph.D. dissertation)<br />
A thesis on categorical programming, exploring inductive and coinductive types, and several programming constructs related to them in Haskell</p></blockquote>
<p>In conclusion, I stated as follows:</p>
<blockquote>
<pre>I would believe that having specific Haskell code to help interact
with the categorical examples would help to motivate study of the
abstract theory for many programmers.  One problem that many people
have with studying abstract theory in isolation is that they often
tend to lose motivation unless they can see how the theory directly
relates to and influences the semantics and data structures in the
code.  Having specific examples of Haskell code to tie together
immediately with the abstract theory would most likely help to
motivate and maintain interest.</pre>
</blockquote>
<p>Then I discovered a similar <a title="thread" href="http://groups.google.com/group/comp.lang.haskell/browse_thread/thread/ec9639c5cc73efdb#">thread</a> in the USENET newsgroup <a title="comp.lang.haskell" href="http://groups.google.com/group/comp.lang.haskell/topics">comp.lang.haskell</a> which had originated two days earlier, entitled &#8220;Book recommendations on underlying theory,&#8221; dated &#8220;Sun, 11 Jan 2009 15:11:40 -0800 (PST),&#8221; in which a reader nicknamed &#8220;grimey&#8221; was asking for recommended readings on the theory behind Haskell.  Grimey described himself as a programmer who had &#8220;studied physics at the undergrad level,&#8221; and whose mathematical background included &#8220;Diff &amp; Integ. Calc, Linear Algebra, Diff Eq, Advanced (Vector) Calc, [and] Complex Analysis.&#8221;  In particular, he added,</p>
<blockquote><p><span class="fixed_width" style="font-family:Courier,Monospaced;">Although the Vector Calc class was particularly difficult<br />
for me and sort of &#8220;took the wind out of my sails&#8221; and leaving me<br />
adrift on the sea of mathematics for a long time.  I always wanted to<br />
continue on with more abstract math, like algebra and group theory, to<br />
gain understanding of the beauty behind quantum physics; but for<br />
various reasons, that didn&#8217;t happen.  Anyway years later I still use<br />
Linear Algebra and Diff Eq quite frequently for work, and have a good<br />
practical engineer&#8217;s grasp of those topics.  I use advanced calculus<br />
less frequently and I use quaternions for very practical, non-<br />
theoretical way for rotation sequences in 3D.  I am an expert C/C++<br />
programmer. </span></p></blockquote>
<p>He then mentioned the following books as two that had &#8220;piqued [his] interest,&#8221; before asking for further suggestions:</p>
<blockquote><p><a title="Topics in Algebra" href="http://www.amazon.com/Topics-Algebra-I-N-Herstein/dp/0471010901"><em>Topics In Algebra</em></a><br />
by I.N. Herstein<br />
Xerox Corporation: 1975</p>
<p><a title="Lambda-Calculus and Combinators" href="http://www.amazon.com/Lambda-Calculus-Combinators-Introduction-Roger-Hindley/dp/0521898854/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1232103773&amp;sr=8-1"><em>Lambda-Calculus and Combinators</em></a><br />
by J. Roger Hindley and Jonathan P. Seldin<br />
Cambridge: Cambridge University Press, 2008</p></blockquote>
<p>In my <a title="responded" href="http://groups.google.com/group/comp.lang.haskell/msg/ee4d2f2ffdb60805">response</a> linking the two threads, I mentioned Andrzej Jaworski&#8217;s <a title="response" href="http://www.haskell.org/pipermail/haskell/2009-January/020934.html">response</a> to my earlier posting in the first thread, in which he had replied in part that:</p>
<blockquote>
<pre>[T]here are many very good
articles addressing specific issues of Haskell's theoretical foundations (e.g.
<a href="http://www.cs.ut.ee/%7Evarmo/papers/thesis.pdf">http://www.cs.ut.ee/~varmo/papers/thesis.pdf</a>).  They however always assume more than they target to
explain making student turn around them like a dog not knowing which ball to catch first.</pre>
</blockquote>
<p>I.e., the problem was that many such papers depended on parts of other papers, which either depended on other parts of the first paper, or on parts of still other papers.  Then I mentioned a response to this issue that I had received in a private e-mail message from a reader of the first thread, in which that reader had written that:</p>
<blockquote><p><span class="fixed_width" style="font-family:Courier,Monospaced;">&#8230; the problem &#8220;comes from trying to use academic papers as textbooks, a<br />
purpose for which they&#8217;re not usually designed.&#8221;</span></p></blockquote>
<p>I then added that this was the gist of the problem, and, as a possible solution, added a dead-tree-based book that I had read about earlier (already mentioned above):</p>
<blockquote><p><span class="fixed_width" style="font-family:Courier,Monospaced;"><a title="A First Introduction to Categories (Paperback)" href="http://www.amazon.com/Conceptual-Mathematics-First-Introduction-Categories/dp/0521478170">Conceptual Mathematics: A First Introduction to Categories (Paperback) </a><br />
by F. William Lawvere and Stephen Hoel Schanuel<br />
Cambridge: Cambridge University Press, 1997<br />
An elementary introduction</span></p></blockquote>
<p>I added:</p>
<blockquote><p><span class="fixed_width" style="font-family:Courier,Monospaced;">This book is reputed to be interesting even to non-mathematicians at a<br />
philosophical level.  I myself have purchased a copy. </span></p></blockquote>
<p>Then, on an afterthought, in an <a title="additional post" href="http://groups.google.com/group/comp.lang.haskell/msg/5133b4246d3112b3">additional post</a> immediately afterwards, I added that what would be even better would be a mathematical storybook (separate links to the storybooks hyperlinked in the following quoted portion):</p>
<blockquote><p><span class="fixed_width" style="font-family:Courier,Monospaced;">What would be especially interesting would be an introductory storybook on category theory:  a book similar to, say, <a title="Flatland" href="http://www.amazon.com/Flatland-Illustrated-Edwin-Abbot/dp/1406847771/ref=sr_1_2?ie=UTF8&amp;s=books&amp;qid=1232097520&amp;sr=1-2">Flatland</a>, by Edwin Abbott Abbott, or even <a title="Flatterland" href="http://www.amazon.com/Flatterland-Like-Flatland-Only-More/dp/073820675X/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1232097976&amp;sr=1-1">Flatterland</a>, by Ian Stewart.  These books would elevate category theory out of the realm of dry equations into a story which would keep me awake with suspense reading through the night. </span></p></blockquote>
<p>Yes!  What we need is <em>Category Land:  Like <a title="Flatterland" href="http://www.amazon.com/Flatterland-Like-Flatland-Only-More/dp/073820675X/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1232097976&amp;sr=1-1">Flatterland</a>, Only About Categories</em>.  If only a book were so.  Any suggestions?</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dekudekuplex.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dekudekuplex.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dekudekuplex.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dekudekuplex.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dekudekuplex.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dekudekuplex.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dekudekuplex.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dekudekuplex.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dekudekuplex.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dekudekuplex.wordpress.com/84/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dekudekuplex.wordpress.com&blog=5559457&post=84&subd=dekudekuplex&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://dekudekuplex.wordpress.com/2009/01/16/learning-haskell-through-category-theory-and-adventuring-in-category-land-like-flatterland-only-about-categories/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a5af05af2cafbe739659871b86a07820?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Benjamin L. Russell</media:title>
		</media:content>
	</item>
	</channel>
</rss>