On 20-May-1999, Carlos Camarao de Figueiredo <[EMAIL PROTECTED]> wrote:
> 
> Dear Alex Jacobson,
> 
> > Does overloading mean that you don't need MPTC?  One of the nice
> > things about type classes is they provide a nice way of grouping
> > related functions.  Arguably, with overloading, this work would be
> > done by the module system.  Is the module system powerful enough to
> > support this?
> 
> Multi-parameter type classes are not needed. As done with Haskell type
> classes, overloading of functions defined over different type
> *constructors* can be defined (**without restrictions**). I think that
> the grouping of related functions should as you said be done in
> (possibly parameterised) modules.

Just to clarify, Carlos Camarao de Figueiredo is talking about a quite
different idea than the one that I have been talking about.

Mercury has both type classes and ad hoc overloading.  In Mercury each
of these serve different purposes, as I described in previous posts.
Mercury's ad hoc overloading does not give you polymorphism.

In system CT, which Carlos Camarao de Figueiredo has been talking about,
there is a single kind of overloading, intended to replace type classes,
which provides both ad hoc overloading and polymorphism.  The resulting
system is a bit like the polymorphism you get with C++ templates and
overloading: you can have polymorphism without needing to declare the
interface used for the parameters to the polymorphic functions.

On first impression, having just read the paper "Type restrictions for
overloading, without restrictions, declarations or annotations",
I don't think I like system CT very much, because I think declaring
interfaces is very important for software engineering reasons.
Experience with C++ has shown that that the lack of declared interfaces
with C++ templates causes major problems.  At first impression, it seems
to me that a language based on system CT will suffer from the same kinds
of problems.

-- 
Fergus Henderson <[EMAIL PROTECTED]>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED]        |     -- the last words of T. S. Garp.


Reply via email to