Context reduction can introduce opportunities for context improvement, so add an additional `improve' step afterwards.  The bug is demonstrated by the following code:
Context reduction can introduce opportunities for context improvement,
so add an additional `improve' step afterwards.  The bug is demonstrated by
the following code:

class C a b c | a b -> c where
  m :: a -> b -> c

instance C Integer Integer Integer

newtype T a = T a

instance C a b c => C (T a) (T b) (T c)

i :: T Integer
i = undefined

x = m (m i i) i -- this line blows up w/ unresolved top-level overloading

FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs,FranklinChen/Hugs