Thank you, everyone, for the suggestions.<br><br><div class="gmail_quote">On Mon, Mar 21, 2011 at 12:28 PM, Johannes Waldmann <span dir="ltr">&lt;<a href="mailto:waldmann@imn.htwk-leipzig.de">waldmann@imn.htwk-leipzig.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">Alex Rozenshteyn &lt;rpglover64 &lt;at&gt; <a href="http://gmail.com" target="_blank">gmail.com</a>&gt; writes:<br>

<br>
&gt; as part of a larger project of porting<br>
</div>&gt; <a href="http://www.cs.jhu.edu/%7Escott/pl/book/dist/" target="_blank">http://www.cs.jhu.edu/~scott/pl/book/dist/</a>  from ocaml to Haskell.<br>
<br>
Nice idea. I was using a similar approach (interpreters for<br>
various semantic domains) in a course on semantics(+ compilation).<br>
<br>
I modelled it after the Turbak/Gifford book<br>
<a href="http://mitpress.mit.edu/catalog/item/?ttype=2&amp;tid=11656" target="_blank">http://mitpress.mit.edu/catalog/item/?ttype=2&amp;tid=11656</a><br>
(in fact after the book had been praised in this here mailing list,<br>
about two years ago).<br>
<br>
In fact the contents of these two books seem largely similar,<br>
and the following remark holds true:<br>
<br>
Using Haskell as an implementation language, you get a very nice addition:<br>
you can model the semantics domains by Monads, and it&#39;s very natural,<br>
(Identity monad = naive interpreter, Maybe monad = for exceptions e.g. division<br>
by zero, State monad = for assignment, Continuation passing monad =<br>
for CPS style programming).<br>
<br>
Now, neither of the books dare to use the M-word.<br>
Although Turbak is really  &quot;doing monads&quot;: he is clearly<br>
defining several &quot;bind&quot; and &quot;return&quot;, he&#39;s just not naming them as such.<br>
<br>
You may browse my source code (quite unpolished) here<br>
<a href="http://dfa.imn.htwk-leipzig.de/cgi-bin/gitweb.cgi?p=ws10-cb/.git;a=tree" target="_blank">http://dfa.imn.htwk-leipzig.de/cgi-bin/gitweb.cgi?p=ws10-cb/.git;a=tree</a><br>
and there&#39;s a parser as well (in the Exp directory).<br>
<br>
I&#39;d be happy to get comments on my code as well.<br>
Would it look better with Monad transformers?<br>
And there&#39;s some amount of (tree walking) boilerplate<br>
that could perhaps be replaced by some template haskell magic.<br>
But then, magic is no good in teaching...<br>
<br>
Best regards, J.W.<br>
<div><div></div><div class="h5"><br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div>          Alex R</div></div><br>