on master help sign in
Mention ‘Outputable’ and ‘SDoc’ in the section about pretty printing

[skip ci]

commitb5e26f8b6f923d73c75c8735131de5b89e1b9add authormrkkrp <markkarpov92@gmail.com> dateSat 8 Dec 2018, 18:13 (8 years ago) parent912ea9b
1 file changed+6−3
DESIGN.md+6−3
DESIGN.md+6−3
@@ -257,8 +257,10 @@ Implementation can be just a `Reader` monad producing something like text
257257builder. The context of `Reader` can store current indentation and
258258configuration options.
259259
260−Returning to `ghc-exactprint`, if we'll be printing the AST ourselves it
261−makes sense to depend on the [`ghc`][ghc] package directly.
260+As a pretty-printing library we can use [`Outputable`][outputable] (and
261+`SDoc`) from the [`ghc`][ghc] package itself. The benefit is that AST
262+components that we'll want to print are already instances of `Outputable`,
263+so we'll get correct renderings for free.
262264
263265### Configuration
264266
@@ -343,7 +345,7 @@ straightforward:
343345Proposed roadmap (for a single person, about 39 full-time work days):
344346
345347* ~~Create and setup a repo, setup CI (less than 1 day).~~
346−* Implement parsing (2 days).
348+* ~~Implement parsing (2 days).~~
347349* Implement basis for pretty-printing of code. We could take
348350 [this][hindent-printer] as inspiration, although AST from the `ghc`
349351 package may be slightly different. Also, don't forget about annotations
@@ -372,6 +374,7 @@ Proposed roadmap (for a single person, about 39 full-time work days):
372374[stylish-haskell]: https://hackage.haskell.org/package/stylish-haskell
373375[haskell-formatter]: https://hackage.haskell.org/package/haskell-formatter
374376[ghc]: https://hackage.haskell.org/package/ghc
377+[outputable]: https://hackage.haskell.org/package/ghc-8.4.3/docs/Outputable.html
375378[haskell-src-exts]: https://hackage.haskell.org/package/haskell-src-exts
376379[ghc-exactprint]: https://hackage.haskell.org/package/ghc-exactprint
377380[hindent-printer]: https://github.com/commercialhaskell/hindent/blob/master/src/HIndent/Pretty.hs