FIX: tidy up TcSimplify following equality constraints additions
authorsimonpj@microsoft.com <unknown>
Wed, 10 Oct 2007 09:33:34 +0000 (09:33 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 10 Oct 2007 09:33:34 +0000 (09:33 +0000)
commit35fca9fe01fc4eb0d2603577e5d4c300dfb1f919
tree712a905071e65ca0e35a5a2e2465c67cbc3404d9
parent92e2b0900fd095957d18ac8a4020ce3342c7a69b
FIX: tidy up TcSimplify following equality constraints additions

The combination of "type refinement" for GADTs and the new equality
constraints has made TcSimplify rather complicated.  And wrong:
it generated bogus code for cholewo-eval.

This patch is still far from entirely satisfactory.  There are
too many places where invariants are unclear, and the code is
still a bit of a mess.  But I believe it's better, and it passes
the regression tests!  So I think it's good enough for the 6.8 release.

Please merge.

The main changes are:

- get rid of extractLocalResults (which was always suspicious)

- instead, treat the 'refinement' along with 'givens', by
  adding a field to RedEnv, red_reft which travels with red_givens

- I also reworked extractResults a bit, which looked wrong to me
  This entailed changing the Given constructor in Avail to take
  an Inst rather than a TcId
compiler/typecheck/TcSimplify.lhs