[prev in list] [next in list] [prev in thread] [next in thread]
List: haskell-cafe
Subject: Re: [Haskell-cafe] Re: New to haskell: unresolved overloading question
From: Daniel Fischer <daniel.is.fischer () web ! de>
Date: 2005-02-22 13:34:03
Message-ID: 200502221434.03103.daniel.is.fischer () web ! de
[Download RAW message or body]
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic