Allow eager unification with type families.
authorRichard Eisenberg <eir@cis.upenn.edu>
Tue, 15 Mar 2016 02:09:36 +0000 (22:09 -0400)
committerRichard Eisenberg <eir@cis.upenn.edu>
Tue, 15 Mar 2016 03:50:52 +0000 (23:50 -0400)
commit3f5d1a13f112f34d992f6b74656d64d95a3f506d
tree773559e6b97c490d357b3b6998b10fc7ad94f7a0
parent55577a9130738932d022d442d0773ffd79d0945d
Allow eager unification with type families.

Previously, checkTauTvUpdate, used in the eager unifier (TcUnify)
right before writing to a metavar, refused to write a metavar to
a type involving type functions. The reason for this was given
in a Note, but the Note didn't make all that much sense and even
admitted that it was a bit confused. The Note, in turn, referred
to another Note, which it was quite sceptical of, as well.

The type-family check was slowing down performance, so I tried
removing it, running the tests referred to in the Note. The tests
all passed without the check. Looking at more test results, I
saw several error messages improve without the check, and some cases
where GHC looped (T7788, in particular) it now doesn't.

So, all in all, quite a win: Two hairy Notes removed, several lines
of code removed, better performance, and improved output.

[skip ci]
13 files changed:
compiler/typecheck/TcUnify.hs
testsuite/tests/indexed-types/should_compile/T7788.hs [moved from testsuite/tests/indexed-types/should_fail/T7788.hs with 100% similarity]
testsuite/tests/indexed-types/should_compile/all.T
testsuite/tests/indexed-types/should_fail/T2693.stderr
testsuite/tests/indexed-types/should_fail/T4179.stderr
testsuite/tests/indexed-types/should_fail/T5439.stderr
testsuite/tests/indexed-types/should_fail/T7354.stderr
testsuite/tests/indexed-types/should_fail/T7729.stderr
testsuite/tests/indexed-types/should_fail/T7786.stderr
testsuite/tests/indexed-types/should_fail/T7788.stderr [deleted file]
testsuite/tests/indexed-types/should_fail/T9554.stderr
testsuite/tests/indexed-types/should_fail/T9662.stderr
testsuite/tests/indexed-types/should_fail/all.T