G'Caml comes of age

G'Caml, which extends O'Caml with overloading, has been around since O'Caml 2.0something. It is now updated with its own source code (no more patching!) and some new features (generic primitives?) that I don't understand.

I think I remember seeing Simon Peyton-Jones predict somewhere that ML would grow type classes. Will G'Caml metastasize?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Not -> Now

I suspect you meant "now updated" :-)

yup (nt)


From what I understand,

From what I understand, though, aren't type classes different from what G'Caml is doing? Aren't type classes an open form of genericity, where you declare a type interface, and then an arbitrary number of implementations of that type interface can then be declared? Whereas G'Caml is closed by only supporting this in a function definition. What are the advantages to doing it one way verses the other?

a guess: i imagine the

a guess:

i imagine the g'caml way is easy to implement - the generic stuff is localized lexically and so probably easier to add into the compiler. as an implementer i'd prefer that.

the open approach is obviously more extensible. as a programmer i'd prefer that.

Type classes are open

I think that's a really great question. Here'a an answer on why one wants closed overloading:

Type Class Directives and the slides.

As far as an implementation goes, I don't see one around; the paper mentions Helium, but it doesn't have type classes.

As for why open type classes are good, extensibility is really helpful for creating new types and making them comparable via equality, say