Minimise provided dictionaries in pattern synonyms
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 8 Nov 2017 08:52:06 +0000 (08:52 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 8 Nov 2017 11:12:37 +0000 (11:12 +0000)
commit2c2f3cea93733e0c6dd04e1d891082652dcf5ea1
treec73743cc5639e9a4a233465890e5aa24c07a8093
parent30058b0e45e920319916be999de9c4d77da136e7
Minimise provided dictionaries in pattern synonyms

Trac #14394 showed that it's possible to get redundant
constraints in the inferred provided constraints of a pattern
synonym.  This patch removes the redundancy with mkMinimalBySCs.

To do this I had to generalise the type of mkMinimalBySCs slightly.
And, to reduce confusing reversal, I made it stable: it now returns
its result in the same order as its input.  That led to a raft of
error message wibbles, mostly for the better.
29 files changed:
compiler/typecheck/TcDerivInfer.hs
compiler/typecheck/TcErrors.hs
compiler/typecheck/TcPatSyn.hs
compiler/typecheck/TcSimplify.hs
compiler/typecheck/TcType.hs
testsuite/tests/ado/ado004.stderr
testsuite/tests/deriving/should_fail/drvfail004.stderr
testsuite/tests/determinism/determ021/determ021.stdout
testsuite/tests/ghci/scripts/T10963.stdout
testsuite/tests/ghci/scripts/T11524a.stdout
testsuite/tests/ghci/scripts/T11975.stdout
testsuite/tests/ghci/scripts/T12550.stdout
testsuite/tests/indexed-types/should_compile/T3017.stderr
testsuite/tests/indexed-types/should_compile/T8889.stderr
testsuite/tests/indexed-types/should_fail/T1897b.stderr
testsuite/tests/partial-sigs/should_compile/ExtraConstraints1.stderr
testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr
testsuite/tests/partial-sigs/should_compile/T12844.stderr
testsuite/tests/partial-sigs/should_compile/T13482.stderr
testsuite/tests/partial-sigs/should_compile/T14217.stderr
testsuite/tests/patsyn/should_compile/T11213.stderr
testsuite/tests/patsyn/should_compile/T14394.script [new file with mode: 0644]
testsuite/tests/patsyn/should_compile/T14394.stdout [new file with mode: 0644]
testsuite/tests/patsyn/should_compile/all.T
testsuite/tests/rebindable/rebindable6.stderr
testsuite/tests/typecheck/should_compile/Makefile
testsuite/tests/typecheck/should_compile/holes2.stderr
testsuite/tests/typecheck/should_fail/T8883.stderr
testsuite/tests/typecheck/should_fail/tcfail133.stderr