Fwd: when is defaulting supposed to occur?
So, it looks like it is hugs which is not following the report (section 4.5.5 (rule 2) as Iavor noted), which seems to indicate that defaulting only occurs after an entire module is type-checked. - Mark Begin forwarded message:
From: "Iavor S. Diatchki" <diatchki@cse.ogi.edu> Date: Thu Oct 23, 2003 3:07:45 PM US/Pacific To: Mark Tullsen <tullsen@galois.com> Cc: haskell@haskell.org Subject: Re: when is defaulting supposed to occur?
hello, the problem has to do with the monomorphism restriction see section 4.5.5 (rule 2) (or typing hashell in haskell section 11.5.1 for details). bye iavor
Mark Tullsen wrote:
Note the following program x = 1 y = x :: Int
This is accepted by ghc but it is rejected hugs (May 2003 cvs): ERROR "IntegerTest.hs":4 - Type error in type annotation *** Term : x *** Type : Integer *** Does not match : Int
My guess is that hugs is doing defaulting after a "declaration group" is type-checked, but that ghci leaves 'x' with type 'Num a', then processes further declaration groups, and then does defaulting.
I don't see that the report specifies this (did I miss it?).
- Mark
_______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
-- ================================================== | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki | ==================================================
On Thu, Oct 30, 2003 at 04:46:10PM -0800, Mark Tullsen wrote:
So, it looks like it is hugs which is not following the report (section 4.5.5 (rule 2) as Iavor noted), which seems to indicate that defaulting only occurs after an entire module is type-checked.
Yes. It's among the divergences from Haskell 98 listed in the new Hugs User's Guide (under http://cvs.haskell.org/Hugs/pages/documentation.htm) that will be included in the upcoming release.
participants (2)
-
Mark Tullsen -
Ross Paterson