title: How to install Haskell on Mac OS
body: <p>I am trying to install Haskell on my Macbook two days and can not get the success.</p>
  
  <p>What I have done:</p>
  
  <pre><code>$ brew install ghc
  </code></pre>
  
  <p>Fine.  Now I am trying to install </p>
  
  <pre><code>$ cabal install text
  </code></pre>
  
  <p>and get next error messages:</p>
  
  <pre><code>Data/Text.hs:1074:4:
       error: invalid preprocessing directive
        #-}
         ^
  </code></pre>
  
  <p>I have googled and found <a href="https://gist.github.com/pyrtsa/6213784" rel="noreferrer">this</a>.</p>
  
  <p>So:</p>
  
  <ul>
  <li><p>brew install gcc48</p>
  
  <pre><code>$ /usr/local/bin/gcc-4.8 --version  
  gcc-4.8 (GCC) 4.8.2
  Copyright (C) 2013 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  
  $ cat /usr/local/lib/ghc-7.6.3/settings
    [("GCC extra via C opts", " -fwrapv"),
     ("C compiler command", "/usr/local/bin/gcc-4.8"),
     ("C compiler flags", " -m64 -fno-stack-protector  -m64"),
     ...
  </code></pre></li>
  <li><p>brew install cabal-install</p></li>
  <li>cabal install text</li>
  </ul>
  
  <p>And I get the same messages. </p>
  
  <p>How can I fix them ?</p>