
Is it possible to automatically derive instances of Prettyhttp://haskell.org/ghc/docs/latest/html/libraries/haskell-src/Language-Haske...? If no, what do most do when it comes to pretty-printing large data types? Thanks, Greg

On Thu, Jan 31, 2008 at 03:00:15PM -0800, Greg Fitzgerald wrote:
Is it possible to automatically derive instances of Prettyhttp://haskell.org/ghc/docs/latest/html/libraries/haskell-src/Language-Haske...? If no, what do most do when it comes to pretty-printing large data types?
It should be pretty trivial to do with my and ndm's Data.Derive library. I'm not sure anymore if it has a prettyprinter; I remember doing the groundwork and finding it fairly easy. I *think* I got distracted trying to write a fast prettyprinter. Stefan

Greg Fitzgerald wrote:
Is it possible to automatically derive instances of Pretty http://haskell.org/ghc/docs/latest/html/libraries/haskell-src/Language-Haske...? If no, what do most do when it comes to pretty-printing large data types?
We do it manually. Usually you have to decide anyway which bits to omit or add (only implicitly indicated by a data constructor) and if you compose things vertically or beside (or nested or whatever) to make it look pretty. HTH Christian see i.e an abstract syntax at: http://www.dfki.de/sks/hets/src-distribution/daily/Hets/docs/CASL-AS_Basic_C... the pretty printer code is here http://www.dfki.de/sks/hets/src-distribution/daily/Hets/CASL/ToDoc.hs our pretty printer wrapper (for text and latex tailored for Hets) http://www.dfki.de/sks/hets/src-distribution/daily/Hets/docs/Common-Doc.html (try "versions" instead of "daily", if a "daily" went wrong)
participants (3)
-
Christian Maeder
-
Greg Fitzgerald
-
Stefan O'Rear