> This occurs because in the absense of type declarations,
> Haskell assumes that any recursion will be monomorphic,
> which is in general not necessarily the case.
As I'm sure you know, type inference is in general impossible
for polymorphic recursion, and since Haskell insists on
decidable type checking this was an easy solution.

Besides, Haskell had polymorphic recursion even before the rule
about a type signature making it possible to make functions
polymorphically recursive.  It was just more tedious to write
it before.

> Interestingly, the Mercury typechecker behaves differently
> for the equivalent example: it infers the more general type.
Are you sure Mercury doesn't suffer from the same problem if
you just complicate the example?

   -- Lennart


Reply via email to