[GHC] #10735: Smooth out the differences between `compiler/utils/Pretty.hs` and `libraries/pretty`
GHC
ghc-devs at haskell.org
Tue Aug 4 11:06:38 UTC 2015
#10735: Smooth out the differences between `compiler/utils/Pretty.hs` and
`libraries/pretty`
-------------------------------------+-------------------------------------
Reporter: thomie | Owner: thomie
Type: task | Status: new
Priority: normal | Milestone: 7.12.1
Component: Compiler | Version: 7.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #1062, #1176, | Differential Revisions:
#7666 |
-------------------------------------+-------------------------------------
Comment (by bgamari):
Replying to [comment:1 thomie]:
> I have patches.
Lovely. Will we be seeing them on Phab soon?
On a related note, I've recently been thinking about error reporting with
an eye for making the messages produced by GHC more useful to external
tools. I've described one possible approach in ticket:8809#comment:3 which
would involve making `Doc` a sort of free functor, allowing the insertion
of rich AST objects into the document. Monadic semantics would certain
patterns of projecting out these annotations into vanilla documents quite
convenient.
Unfortunately, the Hughes/Peyton-Jones pretty-printer isn't terribly well-
suited for this as you need to know the width of a node's parent during
construction. I've been meaning to explore adopting the Wadler/Leijen
pretty-printer as Edward Kmett has already
[http://hackage.haskell.org/package/wl-pprint-extras-3.5.0.5/docs/Text-
PrettyPrint-Free.html demonstrated] that an implementation with
annotations along the lines of my proposal is possible.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10735#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list