On 15-Jul-1998, Alex Ferguson <[EMAIL PROTECTED]> wrote:
> 
> Fergus Henderson, replaying to me:
> > > 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
> 
> This would be ruled out as the size of the context is greater than the
> size of the instance head.

Oh, of course.  Sorry, it's me who is the one talking through my hat ;-)

I think your rule would work.

But it would rule out some potentially useful cases, like

        instance Printable [(k,v)] => Printable (Map k v) where
                print m = print (map_to_assoc_list m)

so I would prefer no such restriction, even if this means the type
system is undecidable.  As noted, undecidability isn't a significant
problem in practice...

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