[Haskell-cafe] (Un)termination of overloading resolution

Ross Paterson ross at soi.city.ac.uk
Wed Feb 22 03:51:32 EST 2006

On Tue, Feb 21, 2006 at 07:13:17PM -0800, oleg at pobox.com wrote:
> I'm afraid that may still be insufficient, as the following
> counter-example shows. It causes GHC 6.4.1 to loop in the typechecking
> phase. I haven't checked the latest GHC.

The HEAD is more cautious:

    Variable occurs more often in a constraint than in the instance head
      in the constraint: E m a b
    (Use -fallow-undecidable-instances to permit this)
    In the instance declaration for `Foo m (a -> ())'

This is required for all instances.  GHC 6.4 relaxed it in the presence
of FDs on the classes in the context, but as you've shown that is dangerous.

More information about the Haskell-Cafe mailing list