[commit: ghc] master: Do pretty-printing of TyThings via IfaceDecl (Trac #7730) (b4856f9)

git at git.haskell.org git at git.haskell.org
Tue Jun 3 16:12:33 UTC 2014


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

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

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

commit b4856f9f4f0fb3db473901b247d3fa94a11c25a0
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Jun 3 14:15:52 2014 +0100

    Do pretty-printing of TyThings via IfaceDecl (Trac #7730)
    
    All the initial work on this was done fy 'archblob' (fcsernik at gmail.com);
    thank you!
    
    I reviewed the patch, started some tidying, up and then ended up in a huge
    swamp of changes, not all of which I can remember now.  But:
    
    * To suppress kind arguments when we have -fno-print-explicit-kinds,
        - IfaceTyConApp argument types are in a tagged list IfaceTcArgs
    
    * To allow overloaded types to be printed with =>, add IfaceDFunTy to IfaceType.
    
    * When printing data/type family instances for the user, I've made them
      print out an informative RHS, which is a new feature. Thus
            ghci> info T
            data family T a
            data instance T Int = T1 Int Int
            data instance T Bool = T2
    
    * In implementation terms, pprIfaceDecl has just one "context" argument,
      of type IfaceSyn.ShowSub, which says
           - How to print the binders of the decl
             see note [Printing IfaceDecl binders] in IfaceSyn
           - Which sub-comoponents (eg constructors) to print
    
    * Moved FastStringEnv from RnEnv to OccName
    
    It all took a ridiculously long time to do.  But it's done!


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

b4856f9f4f0fb3db473901b247d3fa94a11c25a0
 compiler/basicTypes/OccName.lhs                    |  31 +-
 compiler/iface/IfaceSyn.lhs                        | 528 ++++++++++++++------
 compiler/iface/IfaceType.lhs                       | 548 ++++++++++++++++-----
 compiler/iface/LoadIface.lhs                       |   6 +-
 compiler/iface/MkIface.lhs                         |  68 ++-
 compiler/iface/TcIface.lhs                         | 160 +++---
 compiler/main/GHC.hs                               |   3 +-
 compiler/main/PprTyThing.hs                        | 301 ++---------
 compiler/rename/RnEnv.lhs                          |  20 +-
 compiler/typecheck/TcRnDriver.lhs                  |   5 +-
 compiler/types/FamInstEnv.lhs                      |  10 +-
 ghc/InteractiveUI.hs                               |   2 +-
 testsuite/tests/ghci/scripts/T4087.stdout          |   2 +-
 testsuite/tests/ghci/scripts/T4175.stdout          |  26 +-
 testsuite/tests/ghci/scripts/T5417.stdout          |   2 +-
 testsuite/tests/ghci/scripts/T7873.stdout          |   4 +-
 testsuite/tests/ghci/scripts/T7939.stdout          |  16 +-
 testsuite/tests/ghci/scripts/T8674.stdout          |   4 +-
 testsuite/tests/ghci/scripts/all.T                 |   1 +
 testsuite/tests/ghci/scripts/ghci025.stdout        |   6 +-
 .../indexed-types/should_compile/T3017.stderr      |  21 +-
 .../indexed-types/should_fail/ClosedFam3.stderr    |   9 +-
 .../tests/rename/should_fail/rnfail055.stderr      |  12 +-
 testsuite/tests/roles/should_compile/Roles1.stderr |  64 +--
 .../tests/roles/should_compile/Roles14.stderr      |   6 +-
 testsuite/tests/roles/should_compile/Roles2.stderr |  16 +-
 testsuite/tests/roles/should_compile/Roles3.stderr |  29 +-
 testsuite/tests/roles/should_compile/Roles4.stderr |  11 +-
 testsuite/tests/roles/should_compile/T8958.stderr  |  17 +-
 testsuite/tests/roles/should_fail/Roles12.stderr   |   2 +-
 .../tests/simplCore/should_compile/T4201.stdout    |   6 +-
 .../tests/simplCore/should_compile/T4918.stdout    |   4 +-
 testsuite/tests/th/TH_Roles2.stderr                |   9 +-
 .../tests/typecheck/should_compile/tc231.stderr    |  23 +-
 testsuite/tests/typecheck/should_fail/T3468.stderr |   2 +-
 35 files changed, 1096 insertions(+), 878 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 b4856f9f4f0fb3db473901b247d3fa94a11c25a0


More information about the ghc-commits mailing list