[m-dev.] Abstract type classes.

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Oct 11 19:29:20 AEST 2002


On 11-Oct-2002, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> 1. It seems we support abstract type classes, but I can't find
> mention of it in the reference manual.

AFAIK you are correct on both counts.
There also don't seem to be any test cases for this feature.

Patches welcome... ;-)

> 2. We currently disallow instance definitions for abstract types that
> are defined as equivalence types.  Is there a reason why we could not
> relax this so that we can allow such instance definitions provided
> the type is also defined in the same module?

Well, it would complicated code generation; the compiler would have to
generate *two* base_typeclass_info definitions, one for the abstract
type and one for the concrete type.

But yes, it would be possible.  I mentioned this possibility in an
earlier discussion - see "Alternative 4" in
<http://www.cs.mu.oz.au/research/mercury/mailing-lists/mercury-users/mercury-users.9902/0001.html>.

(If we do take this path, it might also make sense to allow instance
definitions in sub-modules of the module which defines the type.)

-- 
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