[m-dev.] file streams

Ralph Becket rbeck at microsoft.com
Tue Dec 28 22:48:22 AEDT 1999


> From: Fergus Henderson [mailto:fjh at cs.mu.OZ.AU]
> > Isn't `instance stream__duplex' implied by 
> > `instance stream__{in,out}put'?  Or is the
> > declaration necessary?
> 
> No, the declaration is necessary.  Even if a type class has no
> methods of its own, you need to an explicit instance declaration
> for each type that is an instance of that typeclass.
> After all, in general there might be semantics (e.g. additional
> axioms) associated with membership in a type class.  Possessing
> definitions for all the methods doesn't necessarily guarantee
> that a type's semantics are correct for membership in a given
> type class.

I thought that might be the case; I was taking the notation
(implication) too literally.  Is it worth making a note in the
reference manual about the distinction?

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