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 more general type for x you have to write it down yourself.
And then the program works perfectly.
x :: Num a => a
x = 1
Why GHC does accept this program is a mystery to me. Unfortunately I cannot
try it myself (yet).
Kind regards,
Arjan
--
Arjan van IJzendoorn (http://www.cs.uu.nl/~afie)
Teacher and part-time Mondrian hacker