Refactor to eliminate FamTyConShape
authorSimon Peyton Jones <simonpj@microsoft.com>
Sun, 3 Sep 2017 11:18:10 +0000 (12:18 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 14 Sep 2017 07:37:26 +0000 (08:37 +0100)
commit0390e4a0f61e37bd1dcc24a36d499e92f2561b67
tree3343a3a507410cf9d938ef621df342b736155529
parent8bf865d3db69c6f4a09f3e5e3880c087c0a7c7f0
Refactor to eliminate FamTyConShape

Consider this note (TcTyClsDecls)

  Note [Type-checking type patterns]
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  When typechecking the patterns of a family instance declaration, we can't
  rely on using the family TyCon itself, because this is sometimes called
  from within a type-checking knot. (Specifically for closed type families.)
  The FamTyConShape gives just enough information to do the job.

I realised that this exact purpose can be served by TcTyCons, and
in fact rather better.  So this patch

* Refactors FamTyConShape out of existence, replacing it with TcTyCOn

* I also got rid Type.filterOutInvisibleTyVars, which was a very
  complex way to do something quite simple.  I replaced the calls
  with TyCon.tyConVisibleTyVars.

No change in behaviour.
compiler/typecheck/TcInstDcls.hs
compiler/typecheck/TcSplice.hs
compiler/typecheck/TcTyClsDecls.hs
compiler/types/TyCon.hs
compiler/types/Type.hs
compiler/types/Type.hs-boot