[m-dev.] Re: For review: changes to graph.m
Fergus Henderson
fjh at cs.mu.oz.au
Thu Jun 5 18:27:28 AEST 1997
David Glen JEFFERY, you wrote:
>
> > Given this argument, and given that a predicate written for a type class
> > doesn't use operations not promised by that type class, then I'd argue
> > that different types in a type class must have the same semantics as far
> > as can be seen from that type class.
>
> One of the classic examples of the problems caused by overlapping instances is
> something like:
>
> typeclass Showable a where ...
>
> In this example, there are two instances which have different semantics. They
> are also overlapping, and using the wrong one would be a Bad Thing(TM).
That's actually a different problem. Gofer _does_ allow that, I think.
Peter was talking about allowing the system to pick a type for you,
any type which satisfied the constraints. (That's what I mistakenly
said that I thought gofer did, in my original mail.)
Here's an example of why letting the system pick a type for you
causes problems:
main --> read(X), write(X).
Anything which is a member of the type classes `readable' and `writeable'
should work, right? But clearly this will have different effects depending
on which type is chosen.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
More information about the developers
mailing list