[Haskell-cafe] Re: Scraping boilerplate deriving?
malcolm.wallace at me.com
Wed Sep 15 04:31:42 EDT 2010
> That's what I had originally. However, some people have made critical
> comments about CPP macros on this list and I thought that TH was
> considered the better option.
I was one of those people advising against the use of CPP macros.
However, Template Haskell is ghc-only, and is unlikely ever to be
implemented by any other Haskell compiler. Thus CPP, for all its
faults, may be the better solution here, simply because it is portable.
(I also note in passing that ghc's core libraries themselves use
exactly this kind of CPP macro to generate lots of tedious boilerplate.)
More information about the Haskell-Cafe