Make simplifyInstanceContexts deterministic
authorBartosz Nitka <niteria@gmail.com>
Tue, 10 May 2016 12:32:28 +0000 (05:32 -0700)
committerBartosz Nitka <niteria@gmail.com>
Tue, 10 May 2016 12:33:52 +0000 (05:33 -0700)
commitb58b0e18a568bbf6381a85eea7adc72679355671
tree334bf7fd0d3aa80ee592bc8daab57ce304dc7801
parent4ac0e815739f6362c2815dd3ae531055a095d6a9
Make simplifyInstanceContexts deterministic

simplifyInstanceContexts used cmpType which is nondeterministic
for canonicalising typeclass constraints in derived instances.
Following changes make it deterministic as explained by the
Note [Deterministic simplifyInstanceContexts].

Test Plan: ./validate

Reviewers: simonmar, goldfire, simonpj, austin, bgamari

Reviewed By: simonpj

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2173

GHC Trac Issues: #4012
compiler/basicTypes/Unique.hs
compiler/basicTypes/Var.hs
compiler/typecheck/TcDeriv.hs
compiler/types/Type.hs