[m-dev.] Foreign type compare and unification

Mark Brown dougl at cs.mu.OZ.AU
Thu May 23 14:45:01 AEST 2002


On 22-May-2002, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> > What I'm saying is that the behaviour of the program should not depend on
> > a closed world assumption about the members of a typeclass.
> 
> Why not?  No, really.
> 
> I think it makes sense for me to be able to indicate that a type
> belongs in a type class (and define its methods) when I declare the
> type.  It also makes sense for me to be able to specify that a type
> belongs in a class (and define its methods) when I want to use that
> type.  But when someone else using that type in another way in another
> part of the code declares that type to be in a class (and define its
> methods), it does not make sense that this should have any effect on
> my code.

Do you mean an effect on the validity of your code, or on the behaviour
of your code?  If you mean the latter, then aren't we in violent
agreement?

> My conjecture is that if I could define an equavalence type, but the
> old type's class memberships did not flow automatically to the new
> one,

For the record, I consider this to be an abuse of the concept of
"equivalent".  If type X is in a class, and type Y is not in that class,
how can X and Y be equivalent?  (I seem to recall this being debated
some time ago.)

Cheers,
Mark.

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