Yet another attempt at inferring the right quantification
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 5 Apr 2017 12:46:03 +0000 (13:46 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 6 Apr 2017 11:33:56 +0000 (12:33 +0100)
commitbac95f9de5bd8d0a647a3a1e4492497603c2fda2
tree1b0926bf98d2a6ec8f4bd3e486e35b0ee1e26f2c
parentc90f8334fa99e8de1ecb7b135a2846bc4d2bf25a
Yet another attempt at inferring the right quantification

TcSimplify.decideQuantification is truly a tricky function!
Trac #13509 showed that we were being over-eager with defaulting
of runtime-rep variables (levity polymorphism), which meant that
a program was wrongly rejected, and with a very odd error message
(c.f. Trac #13530)

I spent an unreasonably long time figuring out how to fix this
in a decent way, and ended up with a major refactoring of
decideQuantification, with a kock-on effect in simplifyInfer.

It is at least a bit more comprehensible now; but I still
can't say I like it.
compiler/typecheck/TcMType.hs
compiler/typecheck/TcSimplify.hs
testsuite/tests/indexed-types/should_fail/ExtraTcsUntch.stderr
testsuite/tests/typecheck/should_compile/T13509.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T