Hi Olaf,
| I'm surprised to learn that Hugs does not start type checking with the
| signature, if a signature is given. ...
| ... So I thought that any Haskell type checker
| would start type checking with the signature, if it is given (signatures also
| give you smaller strongly connected components in the dependency graph).
| Which method does the Hugs type checker use to type check polymorphic
| recursion?
Hugs does indeed start with type signatures provided by the user because,
as you say, that's what you need to do to support polymorphic recursion.
The example that prompted this discussion, however, a type annotation,
and not a type signature declaration. Compare:
foo :: Double with foo = 23 :: Double
foo = 23
Hope this clarifies things!
Your comment about giving smaller strongly connected components is
interesting. I noticed the same thing a couple of years ago, and the
Hugs type checker uses this observation to type check some programs
that might otherwise be rejected. I'd be interested to hear if you
know of any other systems that do the same. I'm not sure there are
any other Haskell systems that do this just yet, but I wait to be
corrected ...
Mark