[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:

the pretty printer code is here

our pretty printer wrapper (for text and latex tailored for Hets)

(try "versions" instead of "daily", if a "daily" went wrong)

More information about the Haskell-Cafe mailing list