I can't seem to get a few Haskell packages to install on my Mac (10.6.8). I first tried Happstack and it failed and then I tried Snap.
Sometimes when I run ghci I get a segmentation fault.
Other times it works and goes like this:
GHCi, version 7.4.2: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude>
When trying to get Snap:
....
....
....
Loading package vector-0.10.0.1 ... linking ... done.
Loading package zlib-0.5.4.0 ... linking ... done.
Loading package zlib-bindings-0.1.1.3 ... linking ... done.
Loading package zlib-enum-0.2.3 ... linking ... done.
Loading package snap-core-0.9.3.1 ... linking ... done.
Loading package snap-server-0.9.3.3 ... linking ... done.
Loading package directory-tree-0.11.0 ... linking ... done.
cabal: Error: some packages failed to install:
snap-0.11.2 failed during the building phase. The exception was:
ExitFailure 11
I have seen this problem a few times but nothing really solved it for me. Any ideas?
Update: February 2016: Whilst other answers were helpful, I didn't find a complete, up-to-date answer.
The install is easy:
An extra step I needed to perform post-install was:
followed by:
See here for details.
Alternatively, instead of using homebrew for the install, visit Haskell Platform for the installer disk image - note that Haskell Platform is only compatible with OS X 10.6 and later.
Although, as a general rule I always use homebrew to manage my dependencies, when it comes to Haskell my recommendation (unless you really know what you are doing) is to just install this binary. This avoids any surprises further down the road. There is excellent documentation post install locally at: file:///Library/Haskell/doc/start.html
The popular answer to this question (using brew to install haskell-platform) is no longer supported.
Late 2017 answer. I'm running macOS Sierra -- 10.12.6 (16G29). This worked successfully with an install time on my MacBook Air of under five minutes:
brew cask install haskell-platform
Then
ghc --version
reported:The Glorious Glasgow Haskell Compilation System, version 8.2.1
This is an old question but given it comes quiet high on Google search. This is how I got here.
Source: http://seanhess.github.io/2015/08/04/practical-haskell-getting-started.html
Why stack and not cabal?
Edit:
I found annoying to have to write "stack ghci" each time I wanted to use "ghci". A solution to this was to simply add these lines to the ~/.bash_aliases file:
Then source the file to apply:
Then I can run ghci and / or haskell running these commands, and it will use the stack version:
brew install haskell-platform
is no longer supported. You may want toHave you tried using homebrew? It handles the dependencies for you. I am on Mac OS X 10.7.5, but these instructions should work for you.
Using homebrew, you can install haskell-platform using the brew command. It will take a while. The compile stage for haskell-platform took 15 minutes.
Since
haskell-platform
on homebrew for Mac is deprecated, you can usebrew install ghc cabal-install
instead. I did it on Yosemite and it took about one minute…