No - ghc is quite right on this one. The use of x in the module
disambiguates the overloading of x here - any use of x in the module
that resolves the overloading should make the monomorphism rule
happy. Unfortunately, hugs applies defaulting too soon and the use of
x that would satisfy monomorp
Hello Fergus,
> x = 1
The monomorphism restriction means that functions without parameters should
in principle not be overloaded. The fact that Hugs doesn't complain is
probably because some "default" mechanism is at work. And it happens to
choose Integer as a default.
If you want the mor
The following program compiles fine with ghc 4.04,
x = 1
main = print (x :: Int)
but when I try it with the "May 1999" version of Hugs,
I get a type error:
ERROR "bug2.hs" (line 2): Type error in type annotation
*** Term : x
*** Type :