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

git at git.haskell.org git at git.haskell.org
Fri Sep 30 15:17:54 UTC 2016


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

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

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

commit 2e1c0da4ef971f4f4cf61d1b780cdf318a8317ef
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.


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

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


More information about the ghc-commits mailing list