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

Bulat Ziganshin bulatz at HotPOP.com
Thu Oct 27 09:41:20 EDT 2005


Hello Johannes,

Tuesday, October 04, 2005, 4:26:27 PM, you wrote:

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

JW> so I'd like to investigate whether I could get the same effect
JW> with Template Haskell (in ghc) - and what this would cost.

well, it is not so pretty, but it works :)

try "ghc --make -ddump-splices test-derive.hs"

i wrote this to include in doc as an example of using reification
facilities, so if it can be simplified or better documented - say to me
:)


-- 
Best regards,
 Bulat                            mailto:bulatz at HotPOP.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-derive.hs
Type: application/octet-stream
Size: 173 bytes
Desc: not available
Url : http://www.haskell.org//pipermail/template-haskell/attachments/20051027/94bfbd1f/test-derive.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: derive.hs
Type: application/octet-stream
Size: 1847 bytes
Desc: not available
Url : http://www.haskell.org//pipermail/template-haskell/attachments/20051027/94bfbd1f/derive.obj


More information about the template-haskell mailing list