Haskellで条件コンパイルは cpp(1) が嫌ならCabalを使えと

Haskellにifdefが無い」とブチ切れてた件 (id:flalin:20101002:1286031678) の続き.

Question: The Cabal documentation suggests to use the C preprocessor on Haskell code in order to adapt to system specific behaviour. I find this ugly. Is there another way?

Answer: You can put modules with the same name and API in different directories and choose the right module using a Cabal test.