Improve consistency checking for derived instances
authorsimonpj@microsoft.com <unknown>
Mon, 26 Jun 2006 10:00:34 +0000 (10:00 +0000)
committersimonpj@microsoft.com <unknown>
Mon, 26 Jun 2006 10:00:34 +0000 (10:00 +0000)
commit7f0ce617a0380339da927433dc816e45704db0be
treeb15b20ce975a3dce5ada669ff62bfe2e351ccf92
parent7f546581e86c816ece1f7c877560ffa1cf385165
Improve consistency checking for derived instances

This patch arranges that derived instances use the same instance-decl
checking code as user-defined instances.  That gives greater consistency
in error messages.

Furthermore, the error description if this consistency check fails is now
much more explicit.  For example, drvfail003 now says
     Variable occurs more often in a constraint than in the instance head
       in the constraint: Show (v (v a))
     (Use -fallow-undecidable-instances to permit this)
     In the derived instance
       instance (Show (v (v a))) => Show (Square_ v w a)
compiler/typecheck/TcDeriv.lhs
compiler/typecheck/TcSimplify.lhs