[Haskell-cafe] Re: derive Pretty?
Christian Maeder
Christian.Maeder at dfki.de
Fri Feb 1 05:32:35 EST 2008
Greg Fitzgerald wrote:
> Is it possible to automatically derive instances of Pretty
> <http://haskell.org/ghc/docs/latest/html/libraries/haskell-src/Language-Haskell-Pretty.html>?
> 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_CASL.html
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)
More information about the Haskell-Cafe
mailing list