[commit: ghc] master: Refactor to eliminate FamTyConShape (0390e4a)

git at git.haskell.org git at git.haskell.org
Thu Sep 14 09:12:47 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/0390e4a0f61e37bd1dcc24a36d499e92f2561b67/ghc

>---------------------------------------------------------------

commit 0390e4a0f61e37bd1dcc24a36d499e92f2561b67
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Sun Sep 3 12:18:10 2017 +0100

    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.


>---------------------------------------------------------------

0390e4a0f61e37bd1dcc24a36d499e92f2561b67
 compiler/typecheck/TcInstDcls.hs   |   4 +-
 compiler/typecheck/TcSplice.hs     |  40 +++++--------
 compiler/typecheck/TcTyClsDecls.hs | 117 +++++++++++++++----------------------
 compiler/types/TyCon.hs            |  14 ++++-
 compiler/types/Type.hs             |   6 +-
 compiler/types/Type.hs-boot        |   2 -
 6 files changed, 78 insertions(+), 105 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 0390e4a0f61e37bd1dcc24a36d499e92f2561b67


More information about the ghc-commits mailing list