For haddock-0.x, Cabal cpp's all the modules with -D__HADDOCK__ because
the old haddock cannot parse all sorts of things.
However for haddock-2.x it is important not to use -D__HADDOCK__ because
the hacks that people added for haddock-0.x would make haddock-2.x fail.
For example they'd simply omit entire declarations. While haddock-0.x
didn't really care and parsed and renamed in a sloppy way, haddoxk-2.x
is basically ghc and so if the module does not compile then it also
cannot be processed via haddock-2.x.
That's quite a presumption there. I can certainly write a module that compiles and produces documentation for Haddock but that is different when compiled into binary form. Even without this particular problem, I can see that being potentially useful.
The proper solution is to make haddock not fail when it encounters TH
code or whatever the original problem was. It can ignore it for now, it
just has to not fail.