[commit: ghc] master: Support for using only partial pieces of included signatures. (5f9c6d2)

git at git.haskell.org git at git.haskell.org
Wed Jan 11 14:54:22 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/5f9c6d2a91ac710e7b75cfe50a7a8e84cc9ae796/ghc

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

commit 5f9c6d2a91ac710e7b75cfe50a7a8e84cc9ae796
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Mon Dec 26 18:39:01 2016 -0800

    Support for using only partial pieces of included signatures.
    
    Summary:
    Generally speaking, it's not possible to "hide" a requirement from a
    package you include, because if there is some module relying on that
    requirement, well, you can't just wish it out of existence.
    
    However, some packages don't have any modules.  For these, we can
    validly thin out requirements; indeed, this is very convenient if
    someone has published a large signature package but you only want
    some of the definitions.
    
    This patchset tweaks the interpretation of export lists in
    signatures: in particular, they no longer need to refer to
    entities that are defined locally; they range over both the current
    signature as well as any signatures that were inherited from
    signature packages (defined by having zero exposed modules.)
    
    In the process of doing this, I cleaned up a number of other
    things:
    
    * rnModIface and rnModExports now report errors that occurred
      during renaming and can propagate these to the TcM monad.
      This is important because in the current semantics, you can
      thin out a type which is referenced by a value you keep;
      in this situation, we need to error (to ensure that all
      types in signatures are rooted, so that we can determine
      their identities).
    
    * I ended up introducing a new construct 'dependency signature;
      to bkp files, to make it easier to tell if we were depending
      on a signature package.  It's not difficult for Cabal to
      figure this out (I already have a patch for it.)
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
    
    Test Plan: validate
    
    Reviewers: simonpj, austin, bgamari
    
    Subscribers: thomie, mpickering
    
    Differential Revision: https://phabricator.haskell.org/D2904
    
    GHC Trac Issues: #12994


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

5f9c6d2a91ac710e7b75cfe50a7a8e84cc9ae796
 compiler/backpack/BkpSyn.hs                        |  7 +-
 compiler/backpack/DriverBkp.hs                     | 50 ++++++++----
 compiler/backpack/NameShape.hs                     | 10 +++
 compiler/backpack/RnModIface.hs                    | 93 +++++++++++++++++----
 compiler/iface/LoadIface.hs                        |  9 ++-
 compiler/main/HeaderInfo.hs                        |  4 +-
 compiler/main/HscMain.hs                           |  2 +-
 compiler/parser/Parser.y                           |  7 +-
 compiler/typecheck/TcBackpack.hs                   | 94 +++++++++++++++++-----
 compiler/typecheck/TcRnExports.hs                  | 15 +++-
 testsuite/tests/backpack/reexport/bkpreex01.bkp    |  4 +-
 testsuite/tests/backpack/reexport/bkpreex02.bkp    |  2 +-
 testsuite/tests/backpack/reexport/bkpreex03.bkp    |  4 +-
 testsuite/tests/backpack/reexport/bkpreex04.bkp    |  2 +-
 testsuite/tests/backpack/reexport/bkpreex06.bkp    |  2 +-
 testsuite/tests/backpack/should_compile/all.T      |  2 +
 testsuite/tests/backpack/should_compile/bkp15.bkp  | 21 ++---
 .../tests/backpack/should_compile/bkp15.stderr     | 18 +++++
 testsuite/tests/backpack/should_compile/bkp25.bkp  |  8 +-
 testsuite/tests/backpack/should_compile/bkp28.bkp  |  2 +-
 testsuite/tests/backpack/should_compile/bkp43.bkp  | 20 +++++
 .../tests/backpack/should_compile/bkp43.stderr     | 14 ++++
 testsuite/tests/backpack/should_compile/bkp44.bkp  | 23 ++++++
 .../tests/backpack/should_compile/bkp44.stderr     | 18 +++++
 testsuite/tests/backpack/should_fail/all.T         |  7 ++
 testsuite/tests/backpack/should_fail/bkpfail03.bkp |  2 +-
 testsuite/tests/backpack/should_fail/bkpfail05.bkp |  2 +-
 testsuite/tests/backpack/should_fail/bkpfail19.bkp |  2 +-
 testsuite/tests/backpack/should_fail/bkpfail20.bkp |  4 +-
 testsuite/tests/backpack/should_fail/bkpfail21.bkp |  4 +-
 .../tests/backpack/should_fail/bkpfail29.stderr    |  4 +-
 testsuite/tests/backpack/should_fail/bkpfail30.bkp |  9 +++
 .../tests/backpack/should_fail/bkpfail30.stderr    |  6 ++
 testsuite/tests/backpack/should_fail/bkpfail31.bkp | 16 ++++
 .../tests/backpack/should_fail/bkpfail31.stderr    |  8 ++
 testsuite/tests/backpack/should_fail/bkpfail32.bkp |  2 +
 .../tests/backpack/should_fail/bkpfail32.stderr    |  5 ++
 testsuite/tests/backpack/should_fail/bkpfail33.bkp |  5 ++
 .../tests/backpack/should_fail/bkpfail33.stderr    |  7 ++
 testsuite/tests/backpack/should_fail/bkpfail34.bkp |  7 ++
 .../tests/backpack/should_fail/bkpfail34.stderr    |  8 ++
 testsuite/tests/backpack/should_fail/bkpfail35.bkp | 13 +++
 .../tests/backpack/should_fail/bkpfail35.stderr    | 16 ++++
 testsuite/tests/backpack/should_fail/bkpfail36.bkp | 10 +++
 .../tests/backpack/should_fail/bkpfail36.stderr    | 10 +++
 45 files changed, 487 insertions(+), 91 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 5f9c6d2a91ac710e7b75cfe50a7a8e84cc9ae796


More information about the ghc-commits mailing list