I have been "scratching a personal itch" lately and was wondering if
anyone else has the same itch. If so, I might spend some time to codify
a sort of preprocessor that produces a more OO Haskell. Right now I'm
doing all of the transformations by hand, instead of relying on an
automated tool.

Some background:
Those who are into the more esoteric aspects of OO know that an object
has both a "type" (interface) and a "class" (implementation). There is
little distinction between the two in C++, but much more distinction in
Java. The OO support that currently exists in Haskell only addresses an
object's interface, and not very conveniently either. The reason I write
"not very conveniently" is because there is kludgy support for interface
inheritance and it is not possible to create a list of values that may
be of different [Haskell] type, but all implement the same interface.

I have come up with some conventions that let me deal with values in a
much more OO framework. That is, there is a clear separation between
interface and implementation. Not only can I inherit interfaces, but I
can also define a default implementation for a class and then inherit
the implementations too. If anyone is interested in these conventions, I
can post a more verbose message, which would detail them all.

But to reiterate the point of this message, would anybody be interested
in a preprocessor that reads in some sort of class/interface definition
and spits out standard Haskell code, which uses the conventions I
alluded to above? My current project probably isn't large enough to
warrant the effort, but if someone else could use it I might be willing
to go the extra mile.

- Michael Hobbs


Reply via email to