[Haskell-cafe] Typeclass resolution errors quite puzzling

Malcolm Wallace malcolm.wallace at me.com
Mon Aug 15 14:40:46 UTC 2016

I have to say that I don't find the original error message confusing at all.  It points directly to the missing instance, namely Eq B.  If you add an instance for Eq B, the program will work.  It is no surprise that the instance Eq A is not mentioned, because there is a perfectly valid instance for it already, and it contains no error.  The /expression/ pointed to by the error message has A values in it, but the error message is correctly steering you away from considering the As, and telling you to consider the Bs instead.


On 15 Aug 2016, at 15:00, Tom Ellis wrote:

> On Mon, Aug 15, 2016 at 03:51:33PM +0200, Francesco Ariis wrote:
>> On Mon, Aug 15, 2016 at 02:48:58PM +0100, Tom Ellis wrote:
>>> I find that message equally puzzling.  It seems to me that the most
>>> helpful message > would have to mention that Eq B is required to
>>> satisfy Eq A.
>> Time to file a feature request then! :)
>>    https://ghc.haskell.org/trac/ghc/wiki/ReportABug
> I shall if I get some confirmation that this is a sane thing to want!
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.

More information about the Haskell-Cafe mailing list