Sven Panne wrote:

> The Haskell 98 report, section 4.3.4 states:
> 
>    [...] In situations where an ambiguous type is discovered, an
>    ambiguous type variable is defaultable if at least one of its
>    classes is a numeric class (that is, Num or a subclass of Num)
>    and if all of its classes are defined in the Prelude or a
>    standard library [...]
> 
> What is the rationale for the second condition, i.e. why is no
> defaulting done when a user-defined class is involved? 

> When no good reason for this restriction exists, it should be removed
> IMHO. This only extends the set of programs which can be compiled, and
> existing programs don't change their meaning.

You will be pleased to hear that neither hbc nor nhc98 implement the
second condition, so your example works fine with those compilers.

Regards,
    Malcolm

----------------------------------------- [EMAIL PROTECTED]
Department of Computer Science, University of York, YORK YO10 5DD, U.K.

Reply via email to