[m-dev.] Foreign type compare and unification

Fergus Henderson fjh at cs.mu.OZ.AU
Tue May 14 17:57:07 AEST 2002

On 14-May-2002, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> Actually, it's the "etc." in your message that is the most
> interesting.  Are you suggesting that the language designers should
> come up with a list of operations that should be defined by default
> for all types, but users would be permitted to override the default?

Well, I didn't have any specific design in mind,
but specifing a fixed list of operations sounds like a bad idea.

> Or are you suggesting that users should be able to define operations
> that could be applied to any type, but still permit other users to
> define specialized versions of those operations for some of their
> types?  The latter would be nicer.

Yes, I agree.

> I think this amounts to a special
> kind of type class of which every type (at least every algebraic type)
> is implicitly an instance, provided that all methods have default
> implementations.

One consequence of this is that if there is an instance declaration,
it must be in the same module as the type definition.

Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au

More information about the developers mailing list