[commit: ghc] master: Clean up TcHsSyn.zonkEnv (184a569)

git at git.haskell.org git at git.haskell.org
Fri Aug 24 09:55:49 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/184a569c5f5fe6e2eed73b2cff35722918c44efd/ghc

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

commit 184a569c5f5fe6e2eed73b2cff35722918c44efd
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Aug 24 08:14:15 2018 +0100

    Clean up TcHsSyn.zonkEnv
    
    Triggered by Trac #15552, I'd been looking at ZonkEnv in TcHsSyn.
    
    This patch does some minor refactoring
    
    * Make ZonkEnv into a record with named fields, and use them.
      (I'm planning to add a new field, for TyCons, so this prepares
      the way.)
    
    * Replace UnboundTyVarZonker (a higer order function) with the
      simpler and more self-descriptive ZonkFlexi data type, below.
     It's just much more perspicuous and direct, and (I suspect)
     a tiny bit faster too -- no unknown function calls.
    
    data ZonkFlexi   -- See Note [Un-unified unification variables]
      = DefaultFlexi    -- Default unbound unificaiton variables to Any
      | SkolemiseFlexi  -- Skolemise unbound unification variables
                        -- See Note [Zonking the LHS of a RULE]
      | RuntimeUnkFlexi -- Used in the GHCi debugger
    
    There was one knock-on effect in the GHCi debugger -- the
    RuntimeUnkFlexi case.  Somehow previously, these RuntimeUnk
    variables were sometimes getting SystemNames (and hence
    printed as 'a0', 'a1', etc) and sometimes not (and hence
    printed as 'a', 'b' etc).  I'm not sure precisely why, but
    the new behaviour seems more uniform, so I just accepted the
    (small) renaming wibbles in some ghci.debugger tests.
    
    I had a quick look at perf: any changes are tiny.


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

184a569c5f5fe6e2eed73b2cff35722918c44efd
 compiler/ghci/RtClosureInspect.hs                  |  15 +-
 compiler/typecheck/TcHsSyn.hs                      | 247 +++++++++++----------
 compiler/typecheck/TcMType.hs                      |  21 +-
 .../tests/ghci.debugger/scripts/print003.stdout    |  10 +-
 .../tests/ghci.debugger/scripts/print006.stdout    |   6 +-
 .../tests/ghci.debugger/scripts/print008.stdout    |   6 +-
 .../tests/ghci.debugger/scripts/print010.stdout    |   4 +-
 .../tests/ghci.debugger/scripts/print012.stdout    |   6 +-
 .../tests/ghci.debugger/scripts/print019.stdout    |   2 +-
 .../tests/ghci.debugger/scripts/print034.stdout    |   2 +-
 10 files changed, 161 insertions(+), 158 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 184a569c5f5fe6e2eed73b2cff35722918c44efd


More information about the ghc-commits mailing list