[mercury-users] Typeclass problem (bug, misunderstanding, oth er?)

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Sep 18 23:20:27 AEDT 2000


On 10-Aug-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 09-Aug-2000, Ralph Becket <rbeck at microsoft.com> wrote:
> > :- typeclass tc(T1, T2) where [
> > 	func e(T1) = T1,
> > 	func f(T1) = T2,
> > 	func g(T1, T2) = T2
> > ].
> 
> The `e' method here is already problematic.  The compiler really ought
> to issue an error or at least a warning at this point, since there is
> no way that e/1 can be called without an ambiguous type error.
> (Thank you for continuing to harp on this point, since by doing so you
> have identified an area in which we can easily improve the compiler's
> diagnostics.)

BTW, we have indeed done so (on Aug 16th).
The compiler now reports the following:

tcbug.m:002: In declaration for function `tcbug:e/1':
tcbug.m:002:   error in type class constraints: type variable
tcbug.m:002:   `T2' occurs only in the constraints,
tcbug.m:002:   not in the function's argument or result types.

-- 
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.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list