| Here's a small illustration of another Hugs diagnostic that bit me today.
| This is with Hugs 98 version 990121 Beta.
| Source code:
| (x, y) = (x, toRational 0.0 % 1000.00)
| Diagnostic:
| ERROR "hugsmsg1.hs" (line 1): Unresolved top-level overloading
| *** Binding : x
| *** Outstanding context : Integral (Ratio Integer)
|
| In the actual case that I was compiling, the mention of x in the diagnostic
| misled me very effectively. It wouldn't even be particularly helpful to
| indicate that the binding context is (x,y), because the error is entirely
| limited to the expression
| toRational 0.0 % 1000.00
Well, in fact the problem isn't entirely limited to the expression you
give at the end here, although I can see why you might think that. In
fact, because x and y are bound together, the context that applies to
the second component of the pair, toRational 0.0 % 1000.00, also applies
to the first component, x. So the Hugs error message is complaining that
the inferred type for x has a context (Integral (Ratio Integer)) which,
can't be resolved because the required instances don't exist, and can't
be retained, because that's not allowed in a top-level pattern binding.
Confusing, yes, but I think the real problem here is coming from
subtleties in the language rather than easily fixed weaknesses in the
diagnostics.
All the best,
Mark