Reorganise TcSimplify (again); FIX Trac #1919
authorsimonpj@microsoft.com <unknown>
Wed, 28 Nov 2007 17:31:46 +0000 (17:31 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 28 Nov 2007 17:31:46 +0000 (17:31 +0000)
commit06f6f35dadc461336675e6d2b8a2192b1f518a1b
tree945286e820ba04cc6cf7ee66b10eb02231d76dd3
parentde7ec7f188c0abfde6d50d5e7501618cc3f715ff
Reorganise TcSimplify (again); FIX Trac #1919

This was a bit tricky.  We had a "given" dict like (d7:Eq a); then it got
supplied to reduceImplication, which did some zonking, and emerged with
a "needed given" (d7:Eq Int). That got everything confused.

I found a way to simplify matters significantly.  Now reduceContext
- first deals with methods/literals/dictionaries
- then deals with implications
Separating things in this way not only made the bug go away, but
eliminated the need for the recently-added "needed-givens" results returned
by checkLoop.  Hurrah.

It's still a swamp.  But it's a bit better.
compiler/typecheck/TcSimplify.lhs