[GHC] #10143: Separate PprFlags (used by Outputable) from DynFlags
GHC
ghc-devs at haskell.org
Sat Mar 7 00:36:52 UTC 2015
#10143: Separate PprFlags (used by Outputable) from DynFlags
-------------------------------------+-------------------------------------
Reporter: ezyang | Owner: ezyang
Type: task | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.11
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple | Blocked By:
Test Case: | Related Tickets:
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
At the moment, SDoc computations have full access to the entirety of
DynFlags, despite only a minusculely small amount of the data structure
being relevant to them. This proposal is to split out a `PprFlags`
structure which will be contained in a `DynFlags`, and contain dynamic
flags JUST for pretty-printing. There will be a function `pprFlags ::
DynFlags -> PprFlags`. This also helps eliminate the circular dependency
between `DynFlags` and `Outputable`.
This structure is not complete, but it should give a sense for some of the
things
that need to be put in here:
{{{
data PprFlags = PprFlags {
pprUserLength :: Int,
pprCols :: Int,
useUnicode :: Bool,
useUnicodeSyntax :: Bool,
targetPlatform :: Platform,
suppressUniques :: Bool,
errorSpans :: Bool,
suppressModulePrefixes :: Bool
}
}}}
I have a patch in-progress which factors this out, but I want to get some
sign-offs that this is a good refactoring before I finish it.
Thanks!
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10143>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list