(one might like to use a different presentation style for
  classes and families, but that is a slightly different matter)

The presentation style is why Haddock needs to know so much about
GHC's language. There are many differences between the pretty printing
requirements of GHC and the HTML output we want from Haddock, so the
HTML backend can not simply re-use the GHC pretty printer. So Haddock
goes through tons of GHC language elements in order to render them in
its own way. I don't know whether some kind of generalized pretty
printer would be a good idea or not.

Would it be possible to have a generic HTML-representation produced by the pretty-printer, with embedded class attributes (class="type family"/class="quasiquote"/..) plus stylesheets that take care of the finer points of rendering each class of syntax in a Haddock-specific way? Then the style-sheets could be
amended to cover new syntax without having to touch Haddock's
source code, unless the new syntax really has to be processed in a new way.

Claus

_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to