Tighten up constraint solve order for RULES
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 14 Jan 2015 10:53:49 +0000 (10:53 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 14 Jan 2015 16:08:54 +0000 (16:08 +0000)
commit6b0cf0e07605d2cde9b4e13b40f52628b6fe64ec
tree87ca2a5130fb968ea9d5990bb04dc2826c66569a
parent0afa37aa342c5c2087b225de76afa23cc2229d9f
Tighten up constraint solve order for RULES

The main point is described in Note [Solve order for RULES].
I'm not sure if the potential bug described there could actually
happen, but I bet it could.  Anyway, this patch explicitly solves
LHS constraints and *then* RHS constraints (see the Note).

I also moved simplifyRule from TcSimplify (a large module) to
TcRules (a small one), which brings related code together.
It did mean I had to export runTcS from TcSimplify, but I think
that's a price worth paying.
compiler/typecheck/TcRules.hs
compiler/typecheck/TcSimplify.hs
testsuite/tests/typecheck/should_fail/T5853.stderr