Simon's proposal seems reasonable -- I've been told that this idea is already
used in Miranda and hbc (with a command line option that I don't know) so it
certainly is feasible.
However ... as Satish has pointed out, we need to be very careful about the
interaction with overloading. In particul
> to permit polymorphic recursion if
> a type signature is provided
>
> Simon
>
> PS This idea is part of the folklore, but I don't know of a reference which
> describes it. Does anyone else? (Specifically the simple type-signature
> solution; ...)
By coincidence, I was just
> From: Simon L Peyton Jones <[EMAIL PROTECTED]>
> [...]
> The standard Hindley-Milner restriction is that a recursive function
> can only be called monomorphically in its own body. Here's an
> example (from an earlier posting to the SML list, which can't typecheck
> under this restriction.
> One modest extension we could make to the Haskell type system is
>
> to permit polymorphic recursion if
> a type signature is provided
...
> This program looks a little odd, but I can personally testify to having
> tripped over this problem in programs that I Really Wanted to wr
Dear people interested in Haskell 1.3,
One modest extension we could make to the Haskell type system is
to permit polymorphic recursion if
a type signature is provided
The standard Hindley-Milner restriction is that a recursive function
can only be called monomorphically in i
Let me see if I have the implementation correct. To typecheck
f :: signature
f = ... f ...
you would first set the type of f from the signature, typecheck the
body of f, and then ensure that the inferred type agrees with the
signature.
This sounds quite reasonable to me. I suppose the hardes
I support Simon's proposal to allow explicitly typed polymorphic recursion.
It is consistent with the exception to the monomorphism restriction
for explicit typings. Let's get a ruling from the type wizards that the
principle is sound, however, and from the implementors that it doesn't
seriously