[commit: ghc] master: Thinning and renaming modules from packages on the command line. (2078752)

git at git.haskell.org git at git.haskell.org
Tue Aug 5 10:15:49 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/207875293fea07aa90efe215369629b657d1875a/ghc

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

commit 207875293fea07aa90efe215369629b657d1875a
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Sat Aug 2 13:50:00 2014 +0100

    Thinning and renaming modules from packages on the command line.
    
    Summary:
    This patch set adds support for extra syntax on -package and related
    arguments which allow you to thin and rename modules from a package.
    For example, this argument:
    
        -package "base (Data.Bool as Bam, Data.List)"
    
    adds two more modules into scope, Bam and Data.List, without adding
    any of base's other modules to scope.
    
    These flags are additive: so, for example, saying:
    
        -hide-all-packages -package base -package "base (Data.Bool as Bam)"
    
    will provide both the normal bindings for modules in base, as well as
    the module Bam.
    
    There is also a new debug flag -ddump-mod-map which prints the state
    of the module mapping database.  H = hidden, E = exposed (so for
    example EH says the module in question is exported, but in a hidden
    package.)
    
    Module suggestions have been minorly overhauled to work better with reexports:
    if you have -package "base (Data.Bool as Bam)" and mispell Bam, GHC
    will suggest "Did you mean Bam (defined via package flags to be
    base:Data.Bool)"; and generally you will get more accurate information.
    Also, fix a bug where we suggest the -package flag when we really need
    the -package-key flag.
    
    NB: The renaming afforded here does *not* affect what wired in
    symbols GHC generates.  (But it does affect implicit prelude!)
    
    ToDo: add 'hiding' functionality, to make it easier to support the alternative
    prelude use-case.
    
    ToDo: Cabal support
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
    
    Test Plan: new tests and validate
    
    Reviewers: simonpj, simonmar, hvr, austin
    
    Subscribers: simonmar, relrod, ezyang, carter
    
    Differential Revision: https://phabricator.haskell.org/D113
    
    GHC Trac Issues: #9375


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

207875293fea07aa90efe215369629b657d1875a
 compiler/main/DynFlags.hs                         |  32 +-
 compiler/main/Finder.lhs                          | 103 +++-
 compiler/main/HscMain.hs                          |   7 -
 compiler/main/HscTypes.lhs                        |  13 +-
 compiler/main/Packages.lhs                        | 626 ++++++++++++++--------
 docs/users_guide/glasgow_exts.xml                 |   6 +-
 docs/users_guide/packages.xml                     |  61 ++-
 ghc/InteractiveUI.hs                              |  12 +-
 ghc/Main.hs                                       |   7 +-
 testsuite/tests/ghci/scripts/T5979.stderr         |   5 +-
 testsuite/tests/{annotations => package}/Makefile |   0
 testsuite/tests/package/all.T                     |  21 +
 testsuite/tests/package/package01.hs              |   3 +
 testsuite/tests/package/package01e.hs             |   3 +
 testsuite/tests/package/package01e.stderr         |  10 +
 testsuite/tests/package/package02.hs              |   5 +
 testsuite/tests/package/package03.hs              |   5 +
 testsuite/tests/package/package04.hs              |   5 +
 testsuite/tests/package/package05.hs              |   4 +
 testsuite/tests/package/package06.hs              |   3 +
 testsuite/tests/package/package06e.hs             |   3 +
 testsuite/tests/package/package06e.stderr         |  10 +
 testsuite/tests/package/package07e.hs             |   5 +
 testsuite/tests/package/package07e.stderr         |  20 +
 testsuite/tests/package/package08e.hs             |   5 +
 testsuite/tests/package/package08e.stderr         |  20 +
 testsuite/tests/package/package09e.hs             |   2 +
 testsuite/tests/package/package09e.stderr         |   5 +
 testsuite/tests/package/package10.hs              |   2 +
 29 files changed, 717 insertions(+), 286 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 207875293fea07aa90efe215369629b657d1875a


More information about the ghc-commits mailing list