[Haskell-cafe] Haskell's overlooked object system: was OO idioms redux

Ben.Yu at combined.com Ben.Yu at combined.com
Wed Oct 13 17:30:10 EDT 2004


Some people say that ocaml's object system is kinda useless. The best
support I hear so far was:"it does not hurt"

implementation inheritance, the strange "#" syntax, virtual method, why do
I need them?

In Java, people are doing programming-against-interface, implementation
injection etc. All these show that we don't need implementation inheritance
to be OO, and implementation inheritance is in many cases bad practice
anyway.

As somebody pointed out, we could do interface in Haskell with record. The
only problem is names. If we could, as we can in OO languages, provide a
separate namespace for the fields of each record. We are pretty much done.

The rest is some kind of record coersion+row polymorphism mechanism.


If haskell can do what Simon P. Jones and Mark Jones described in the paper
<<Lightweight Extensible Records for Haskell>>, I'd say it is a already a
nice functional OO language.
Compared to Ocaml, 'OO' support is seamlessly integrated with the
functional part. It leaves no redundancy, no overlapping in the language.


In short, what if we don't create an object piece that competes with the
functional part, but fix and enhance the record system that we currently
have?


Ben.


This message is intended only for the addressee and may contain information
that is confidential or privileged. Unauthorized use is strictly prohibited
and may be unlawful. If you are not the intended recipient, or the person
responsible for delivering to the intended recipient, you should not read,
copy, disclose or otherwise use this message, except for the purpose of
delivery to the addressee. If you have received this email in error, please
delete and advise the IT Security department at ITSEC at combined.com
immediately



More information about the Haskell-Cafe mailing list