Make the Ord Module independent of Unique order (2nd try)
authorBartosz Nitka <niteria@gmail.com>
Thu, 9 Jun 2016 15:50:32 +0000 (08:50 -0700)
committerBartosz Nitka <niteria@gmail.com>
Wed, 22 Jun 2016 14:28:58 +0000 (07:28 -0700)
commit348f2dbb835b1208f601bb1e8daa1d1d54507eda
treeadaf0e779936e0d86fceb7041920ac6f2eb8044b
parent93f40cb9b93b0308b211eaf4ad8f2fee6cb1b5aa
Make the Ord Module independent of Unique order (2nd try)

The `Ord Module` instance currently uses `Unique`s for comparison.
We don't want to use the `Unique` order because it can introduce
nondeterminism.
This switches `Ord ModuleName` and `Ord UnitId` to use lexicographic
ordering making `Ord Module` deterministic transitively.

I've run `nofib` and it doesn't make a measurable difference.

See also Note [ModuleEnv determinism and performance].

This fixes #12191 - the regression, that the previous version of this
patch had.

Test Plan:
./validate
run nofib: P112

Reviewers: simonmar, bgamari, austin

Subscribers: thomie

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

GHC Trac Issues: #4012, #12191
compiler/basicTypes/Module.hs
compiler/typecheck/FamInst.hs
testsuite/tests/driver/sigof01/all.T
testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail10.stderr
testsuite/tests/rename/should_fail/T11071.stderr
testsuite/tests/rename/should_fail/T11071a.stderr
testsuite/tests/typecheck/should_fail/T6018fail.stderr