Apple finally dropped the GNU C Compiler (GCC) from its developer tools and only supports the LLVM-based clang compiler. This causes the Glasgow Haskell Compiler (GHC) some grief, mainly due to its use of the C pre-processor (cpp) as a cheap macro system for Haskell.
Here is how to fix this for the latest version of the Haskell Platform for Mac — until the HP maintainers release an updated version. I am assuming you have installed Mavericks and that you have either (a) Xcode 5 (from the Mac App Store) with the command line tools installed or (b) have directly gotten the Command Line Tools for Xcode. Using the latest Haskell Platform for Mac, follow these two steps:
- Get and compile Luke Iannini’s clang-xcode5-wrapper and put the binary into
/usr/local/bin— or grab this already compiled binary and put it in
- Edit GHC’s
settingsfile as described next.
by changing the second line of the file, such that it reads
("C compiler command", "/usr/local/bin/clang-xcode5-wrapper")
That’s it! Happy Haskell hacking on the most advanced operating system ;)
 I have long maintained the view that (ab)using cpp for Haskell is a Bad Idea.
 This is a Haskell program; so, either compile it before updating to Mavericks or grab my binary.