SCC analysis for instances as well as types/classes
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 20 Apr 2016 11:56:40 +0000 (12:56 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 20 Apr 2016 13:28:34 +0000 (14:28 +0100)
commit353d8ae6fafe117a1cac4adf6f029a5baccc2780
tree9a55b083e597b0d2d614639a54c85b0119384bd2
parent7319b80a2cdffdfac8586946d0c7b0fdc8d77dae
SCC analysis for instances as well as types/classes

This big patch is in pursuit of Trac #11348.

It is largely the work of Alex Veith (thank you!), with some
follow-up simplification and refactoring from Simon PJ.

The main payload is described in RnSource
  Note [Dependency analysis of type, class, and instance decls]
which is pretty detailed.

* There is a new data type HsDecls.TyClGroup, for a strongly
  connected component of type/class/instance/role decls.

  The hs_instds field of HsGroup disappears, in consequence

  This forces some knock-on changes, including a minor
  haddock submodule update

Smaller, weakly-related things

* I found that both the renamer and typechecker were building an
  identical env for RoleAnnots, so I put common code for
  RoleAnnotEnv in RnEnv.

* I found that tcInstDecls1 had very clumsy error handling, so I
  put it together into TcInstDcls.doClsInstErrorChecks
27 files changed:
compiler/deSugar/DsMeta.hs
compiler/hsSyn/HsDecls.hs
compiler/hsSyn/HsUtils.hs
compiler/parser/RdrHsSyn.hs
compiler/rename/RnEnv.hs
compiler/rename/RnNames.hs
compiler/rename/RnSource.hs
compiler/typecheck/TcDeriv.hs
compiler/typecheck/TcInstDcls.hs
compiler/typecheck/TcInstDcls.hs-boot [new file with mode: 0644]
compiler/typecheck/TcRnDriver.hs
compiler/typecheck/TcTyClsDecls.hs
compiler/typecheck/TcTyDecls.hs
testsuite/tests/deriving/should_fail/T9687.stderr
testsuite/tests/driver/sigof02/Map.hsig
testsuite/tests/ghci/scripts/T4175.stdout
testsuite/tests/indexed-types/should_fail/T8550.stderr
testsuite/tests/polykinds/T8132.stderr
testsuite/tests/rename/should_compile/T4003A.hs-boot
testsuite/tests/roles/should_compile/T8958.stderr
testsuite/tests/th/T1835.stdout
testsuite/tests/typecheck/should_compile/T11348.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T
testsuite/tests/typecheck/should_fail/T6018fail.stderr
testsuite/tests/typecheck/should_fail/tcfail211.stderr
utils/ghctags/Main.hs
utils/haddock