| [Hugs complains about the following module, but GHC 2.06 accepts it]
| ...
| > module Main where
| > plus = zipWith (+)
| > main = putStr (show (plus [1.0] [2.0]))
| ...
| This appears to be a disagreement in the interpretation of the
| monomorphism restriction.
| ...
| So which is correct, Hugs or GHC 2.06?
GHC is correct, and so are you. This is a problem with the implementation
of the monomorphism restriction. We were already aware that there was a
problem; the Hugs type checker doesn't allow a top-level symbol to have
a type with free variables ... which is what is needed here to type check
the program correctly. Instead, it applies a new defaulting rule that
was introduced in the transition from Haskell 1.3 to 1.4, plus gets a
monomorphic type involving Int, and then causes a type error when we try
to check main.
The short term fix, as you already surmised, is to insert an explicit
type signature, preventing the default mechanism from being invoked.
Another possibility would be to add parameters to plus (eta expand),
and so prevent the monomorphism restriction from being invoked.
Longer term, we'd prefer to rewrite the Hugs type checker to be more
flexible and more module-aware.
All the best,
Mark