On 15-Jul-1998, Alex Ferguson <[EMAIL PROTECTED]> wrote:
> 
> Mark Jones:
> > Looking at the `size' of types is, of course, a generalization of Simon's
> > suggestion that contexts might be allowed to constrain only proper sub-
> > expressions of types in the context.  (Proper sub-expressions are, by
> > definition, smaller in size.)  However, it is still too strict to allow
> > useful things like:  instance Monad m => Functor m where ..., so there is
> > still some work to be done ...
> 
> I haven't looked at this in great detail, so forgive me if I'm talking
> through my hat, as seems quite likely: is it workable to require only
> that contexts be non-increasing in size, and that there be no manifest
> circularity where the sizes are non-decreasing?  That is, rule out having
> both instance Monad m => Functor m and instance Functor m => Monad m.
> Or is that not sufficient to ensure termination of CR?

There will still be problems with things like

        instance Foo [m] => Foo m

> Fergus Henderson writes of:
> > the monomorphism restriction (which exists for a similar reason,
> > to ensure termination of type inference).
> 
> Is this true? 

Well, I had assumed that was the reason.  I could be wrong.

> The rationale normally given for it by its advocates
> (boo, hiss) seems invariably the "no re-evaluation of CAFs" mantra.

Could you elaborate about how the "no re-evaluation of CAFs" mantra
justifies the monomorphism restriction?

-- 
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.


Reply via email to