Implict parameters and monomorphism

C.Reinke C.Reinke@ukc.ac.uk
Thu, 03 May 2001 13:31:01 +0100


> > > Try this program:
> > > -- Try commenting out this type signature.
> > > fun:: (Num a) => a -> Int

> > Defaulting applies only when all classes involved are Haskell 98.
> 
> First, I cannot parse that sentence, but I assume you mean when all
> classes are Prelude classes.
> Second, I'm pretty sure we all agreed that this was a silly rule and
> should not be in the Haskell definition.  I was certain that that it had
> been removed from the Haskell report, but I guess not.  (hbc used
> to make this check, but I removed it when everyone seemed to
> agree that rule was a bad idea).

http://research.microsoft.com/~simonpj/haskell98-revised/haskell98-bugs.html

(Could it be made more prominent on www.haskell.org that this Haskell98
 bugs list is indeed part of Simon's ongoing, soon to be completed
 revision of the two reports? Just so that people like me notice that the 
 revised reports take priority over whatever the current ones say..)

  Page 49, Section 4.3.4, Ambiguous Types... 

  In the third paragraph from the end of Section 4.3.4, replace "...an
  ambiguous type variable is defaultable if at least one of its classes
  is a numeric class..." by "...an ambiguous type variable, v, is
  defaultable if v appears only in constraints of the form (C v), where C
  is a class, and if at least one of its classes is a numeric class...".

  The new phrase is "if v appears only in constraints of the form (C v)
  where C is a class". Without this condition the rest of the sentence
  does not make sense.

Claus