On 15-Jul-1998, Alex Ferguson <[EMAIL PROTECTED]> wrote:
>
> Fergus Henderson writes of:
> > the monomorphism restriction (which exists for a similar reason,
> > to ensure termination of type inference).
>
> Is this true? The rationale normally given for it by its advocates
> (boo, hiss) seems invariably the "no re-evaluation of CAFs" mantra.
Thanks to some discussion with Mark Jones, I realized that what I was
calling "the monomorphism restriction" is actually a completely
different restriction to the one everyone else here was discussing.
The one I was talking about is perhaps better called the "monomorphic
recursion" restriction: Haskell only allows polymorphic recursion if
you give an explicit type declaration. This is described in section
4.4.1 of the Haskell report
| However, to ensure that type inference
| is still possible, the defining occurrence, and all uses of f
| within its declaration group must have the same monomorphic type
That is the restriction which Mercury does not have, which can lead
to non-termination.
This is of course a completely different thing to "The monomorphism
restriction" discussed in section 4.5.5.
Sorry for my misuse of terminology, and apologies for any confusion
that resulted!
--
Fergus Henderson <[EMAIL PROTECTED]> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED] | -- the last words of T. S. Garp.