
15 Sep
2010
15 Sep
'10
4:31 a.m.
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.) Regards, Malcolm