[commit: ghc] master: Add debugPprType (805b29b)

git at git.haskell.org git at git.haskell.org
Thu Aug 31 07:17:21 UTC 2017


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

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

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

commit 805b29bb873c792ca5bcbd5540026848f9f11a8d
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Aug 30 08:57:40 2017 +0100

    Add debugPprType
    
    We pretty-print a type by converting it to an IfaceType and
    pretty-printing that.  But
     (a) that's a bit indirect, and
     (b) delibrately loses information about (e.g.) the kind
          on the /occurrences/ of a type variable
    
    So this patch implements debugPprType, which pretty prints
    the type directly, with no fancy formatting.  It's just used
    for debugging.
    
    I took the opportunity to refactor the debug-pretty-printing
    machinery a little.  In particular, define these functions
    and use them:
    
      ifPprDeubug :: SDoc -> SDOc -> SDoc
        -- Says what to do with and without -dppr-debug
      whenPprDebug :: SDoc -> SDoc
        -- Says what to do with  -dppr-debug; without is empty
      getPprDebug :: (Bool -> SDoc) -> SDoc
    
    getPprDebug used to be called sdocPprDebugWith
    whenPprDebug used to be called ifPprDebug
    
    So a lot of files get touched in a very mechanical way


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

805b29bb873c792ca5bcbd5540026848f9f11a8d
 compiler/basicTypes/BasicTypes.hs  |  5 ++--
 compiler/basicTypes/RdrName.hs     |  5 ++--
 compiler/basicTypes/SrcLoc.hs      |  2 +-
 compiler/coreSyn/CoreLint.hs       |  7 ++---
 compiler/coreSyn/PprCore.hs        |  4 +--
 compiler/deSugar/Desugar.hs        |  4 +--
 compiler/ghci/RtClosureInspect.hs  | 26 ++++++++--------
 compiler/hsSyn/HsBinds.hs          |  6 ++--
 compiler/hsSyn/HsExpr.hs           | 20 ++++++-------
 compiler/hsSyn/HsLit.hs            |  2 +-
 compiler/hsSyn/HsPat.hs            |  2 +-
 compiler/hsSyn/HsTypes.hs          |  5 ++--
 compiler/iface/IfaceSyn.hs         |  2 +-
 compiler/iface/IfaceType.hs        |  2 +-
 compiler/iface/LoadIface.hs        |  2 +-
 compiler/nativeGen/Dwarf/Types.hs  |  2 +-
 compiler/nativeGen/X86/Ppr.hs      |  2 +-
 compiler/prelude/ForeignCall.hs    |  2 +-
 compiler/profiling/CostCentre.hs   |  4 +--
 compiler/simplCore/CoreMonad.hs    |  2 +-
 compiler/simplCore/SimplUtils.hs   |  2 +-
 compiler/specialise/Rules.hs       | 13 ++++----
 compiler/specialise/Specialise.hs  |  2 +-
 compiler/stgSyn/StgSyn.hs          | 12 ++++----
 compiler/typecheck/TcRnDriver.hs   |  6 ++--
 compiler/typecheck/TcRnTypes.hs    |  4 +--
 compiler/typecheck/TcSMonad.hs     |  6 ++--
 compiler/typecheck/TcTyClsDecls.hs |  8 ++---
 compiler/types/FamInstEnv.hs       |  2 +-
 compiler/types/InstEnv.hs          |  2 +-
 compiler/types/TyCoRep.hs          | 61 +++++++++++++++++++++++++++++++++++++-
 compiler/utils/Outputable.hs       | 28 +++++++++--------
 32 files changed, 154 insertions(+), 98 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 805b29bb873c792ca5bcbd5540026848f9f11a8d


More information about the ghc-commits mailing list