[commit: ghc] wip/spj-tc-branch2: Refactor occurrence-check logic (c2e6bf0)

git at git.haskell.org git at git.haskell.org
Thu Sep 29 10:36:13 UTC 2016


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

On branch  : wip/spj-tc-branch2
Link       : http://ghc.haskell.org/trac/ghc/changeset/c2e6bf021468881b1557d77506e3bcf38a1de4ad/ghc

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

commit c2e6bf021468881b1557d77506e3bcf38a1de4ad
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Sun Sep 25 03:50:13 2016 +0100

    Refactor occurrence-check logic
    
    This patch does two related things
    
    * Combines the occurrence-check logic in the on-the-fly unifier with
      that in the constraint solver.  They are both doing the same job,
      after all.  The resulting code is now in TcUnify:
         metaTyVarUpdateOK
         occCheckExpand
         occCheckForErrors (called in TcErrors)
    
    * In doing this I disovered checking for family-free-ness and foralls
      can be unnecessarily inefficient, because it expands type synonyms.
      It's easy just to cache this info in the type syononym TyCon, which
      I am now doing.


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

c2e6bf021468881b1557d77506e3bcf38a1de4ad
 compiler/basicTypes/DataCon.hs           |  10 +-
 compiler/iface/TcIface.hs                |   2 +-
 compiler/prelude/TysPrim.hs              |   2 +
 compiler/prelude/TysWiredIn.hs           |   6 +-
 compiler/typecheck/TcCanonical.hs        |  21 +-
 compiler/typecheck/TcErrors.hs           |   7 +-
 compiler/typecheck/TcFlatten.hs          |  49 ++--
 compiler/typecheck/TcTyClsDecls.hs       |   2 +-
 compiler/typecheck/TcType.hs             | 220 +--------------
 compiler/typecheck/TcUnify.hs            | 460 +++++++++++++++++++++++++------
 compiler/types/TyCon.hs                  |  27 +-
 compiler/types/Type.hs                   |  25 +-
 compiler/vectorise/Vectorise/Type/Env.hs |   2 +-
 13 files changed, 481 insertions(+), 352 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 c2e6bf021468881b1557d77506e3bcf38a1de4ad


More information about the ghc-commits mailing list