This sounds like a really interesting question. To save some people weeding through the thread and Jon Harrop&#39;s usual trolling garbage, here&#39;s a description of the problem:<div><br></div><div>[quote]</div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: verdana; ">Here&#39;s [a]language to to interpret (where postfix * means tupling): <br>
<br>Variables: x <br>Integer literals: i <br>Terms: <br><br>t = Lambda x*. t <br>  |  Apply t t* <br>  |  Var(x) <br>  |  Num(i) <br><br>We assume usual operational semantics of lambda calculus (i.e. static scoping). <br>
<br>The task is to write two interpreters, one with variables x being <br>DeBruijn indices and one with them being names. <br>You should go for maximal sharing, i.e. factor out commonalities into <br>a common class/typeclass/functor/whatever, so that there remains no <br>
duplication of code in the two solutions. </span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: verdana;">[/quote]</span></div><div><br></div><div><br><div class="gmail_quote">On Mon, May 4, 2009 at 6:05 AM, Paolo Losi <span dir="ltr">&lt;<a href="mailto:paolo.losi@gmail.com">paolo.losi@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi all,<br>
<br>
I&#39;m following an interesting thread on the scala mailing list:<br>
<br>
<a href="http://www.nabble.com/-scala--usefulness-of-OOP-td23268250.html" target="_blank">http://www.nabble.com/-scala--usefulness-of-OOP-td23268250.html</a><br>
<br>
Martin Odersky advocates the OO features of the scala language<br>
proposing an interesting problem where the OO approach seams<br>
valuable.<br>
<br>
I would be very much interested in seeing an Haskell solution<br>
to that problem. Any haskell guru want to take a stub at it<br>
or give an opinion from a pure FP point of view?<br>
<br>
Thanks<br>
Paolo<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">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>
</blockquote></div><br></div>