[Template-haskell] automatic instances for pretty printing and parsing

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Tue Oct 4 08:26:27 EDT 2005


Dear all,

I use Text.PrettyPrint.HughesPJ and
Text.ParserCombinators.Parsec heavily so I made
some DrIFT rules for deriving the "obvious" instances for

class ToDoc  a where toDoc :: a -> Doc
class Reader a where readerPrec :: Int -> Parser a

http://141.57.11.163/cgi-bin/cvsweb/drift/src/UserRuleToDoc.hs?rev=1.5

Still I'd like to avoid external preprocessors (for hygienic reasons,
and because they do not seem to fit well with the Cabal model)
so I'd like to investigate whether I could get the same effect
with Template Haskell (in ghc) - and what this would cost.
Perhaps someone has solved a similar problem before.

On the other hand, HaXml does need DrIFT it seems.
-- 
-- Johannes Waldmann -- Tel/Fax (0341) 3076 6479/80 --
---- http://www.imn.htwk-leipzig.de/~waldmann/ -------



More information about the template-haskell mailing list