Refactor validity checking for type/data instances
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 22 Jan 2016 16:40:55 +0000 (16:40 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Mon, 25 Jan 2016 11:32:27 +0000 (11:32 +0000)
commit746764cce9a111a082a13bc3cd34b50e34fd2a31
tree1668e8369688c7cfe0d02c6da28433afb21159f2
parentff21795a0b9253e811a45626d5686e981ed07f82
Refactor validity checking for type/data instances

I found that there was some code duplication going on,
so I've put more into the shared function checkValidFamPats.

I did some refactoring in checkConsistentFamInst too,
preparatory to #11450; the error messages change a little
but no change in behaviour.
compiler/typecheck/TcInstDcls.hs
compiler/typecheck/TcTyClsDecls.hs
compiler/typecheck/TcValidity.hs
testsuite/tests/indexed-types/should_fail/SimpleFail2a.stderr