[Haskell-cafe] Interesting Thread on OO Usefulness (scala mailing list)

Andrew Wagner wagner.andrew at gmail.com
Mon May 4 07:46:06 EDT 2009


This sounds like a really interesting question. To save some people weeding
through the thread and Jon Harrop's usual trolling garbage, here's a
description of the problem:
[quote]
Here's [a]language to to interpret (where postfix * means tupling):

Variables: x
Integer literals: i
Terms:

t = Lambda x*. t
  |  Apply t t*
  |  Var(x)
  |  Num(i)

We assume usual operational semantics of lambda calculus (i.e. static
scoping).

The task is to write two interpreters, one with variables x being
DeBruijn indices and one with them being names.
You should go for maximal sharing, i.e. factor out commonalities into
a common class/typeclass/functor/whatever, so that there remains no
duplication of code in the two solutions.
[/quote]


On Mon, May 4, 2009 at 6:05 AM, Paolo Losi <paolo.losi at gmail.com> wrote:

> Hi all,
>
> I'm following an interesting thread on the scala mailing list:
>
> http://www.nabble.com/-scala--usefulness-of-OOP-td23268250.html
>
> Martin Odersky advocates the OO features of the scala language
> proposing an interesting problem where the OO approach seams
> valuable.
>
> I would be very much interested in seeing an Haskell solution
> to that problem. Any haskell guru want to take a stub at it
> or give an opinion from a pure FP point of view?
>
> Thanks
> Paolo
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090504/0b09eae8/attachment.htm


More information about the Haskell-Cafe mailing list