Reproducing my directions I've been sharing with haskellers for the past few months via https://gist.github.com/cartazio/7131371
Type
ghc --print-libdir
The output will be a path like
/Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/lib/ghc-7.6.3
Go to that directory and edit the
settings
file.There'll be a line indicating the path to the C compiler. It'll probably say
/bin/gcc
Change that line to
/usr/local/bin/gcc-4.8
(or whichevergcc
version you brew installed, such as/usr/local/bin/gcc-4.2
)