[Haskell-cafe] Re: New to haskell: unresolved overloading question

Daniel Fischer daniel.is.fischer at web.de
Tue Feb 22 08:34:03 EST 2005


Am Dienstag, 22. Februar 2005 00:34 schrieb Daniel Fischer:
<snip>
> That's a very common problem for newbies, so don't panic.
> In older versions of hugs (November 2002, e.g.), you would have got an
> unresolved overloading also from entering [] to the prompt (this is no
> longer so). If such things happen, add an explicit typing, if that doesn't
> help, then you have a problem.
>
> To deepen the confusion, hugs has no problems with
>
> Prelude> 1.5 == 1.5
> True
>
> I'm not quite sure why this works, must be due to type defaulting, however,

Ah, I found out, carefully rereading the pertinent paragraph of the report 
(4.3.4) informed me that, for the defaulting rules to be applied,
*all Classes in the context must be defined in the Prelude or the standard 
libraries*, which of course ApproxEq isn't.

If you include 
default ()   or default (Integer)
in your script, 
1.5 == 2.4
will also lead to an unresolved overloading, so defaulting really works.

Bye for now,
Daniel


More information about the Haskell-Cafe mailing list