0
votes

I am totally noob in Haskell, I am trying to follow a tutorial on how use it for the web.

I am using Mac OSX so I downloaded the haskell platform for OSX from http://www.haskell.org/platform/mac.html

Then I did

cabal update

It told me that a new version of cabal install was available, so why not cabal install cabal-install

It compiled version Cabal-1.16.0.3 and installed it in my $HOME/Library/Haskell. I prepend $HOME/Library/Haskell/bin to my $PATH and open a new terminal.

Then I do cabal --version

But version is 1.14 I do $HOME/Library/Haskell/bin/cabal --version And I get that the binary is using library version 1.14 How can I get it to use the newly installed version instead of the one of the platform?

Then I do cabal install cabal-dev

And get a message of the new packages to compile but this message also includescabal:

The following packages are likely to be broken by the reinstalls:
network-2.3.1.0
haskell-platform-2012.4.0.0
cgi-3001.1.7.4
HTTP-4000.2.5

I do not like how this sounds.

I prevously tried to install yesod on a different computer and I remember having the same kind of issues and ultimately yesod was not installing, I do not want to do anything that will break anything this time.

What is the correct way to get Yesod or any haskell package to work on mac osx?

1
have you tried serverfault?Amelia
It is more a beginner programmer kind of question than a server related questionuser1565940
"I do not like how this sounds." You're a wise person. The cabal-dev version from github should compile fine. Clone the repo, cd into it, and cabal install.Daniel Fischer

1 Answers

3
votes

How can I get it to use the newly installed version instead of the one of the platform?

As cabal should tell you, you just add the directory to your PATH environment variable. For example, if you use bash as your shell, add

export PATH=$HOME/Library/Haskell/bin:$PATH

to $HOME/.bashrc and restart your shell.

What is the correct way to get Yesod or any haskell package to work on mac osx?

This question is not OSX-specific, but cabal-specific. The answer is to tell cabal all the packages you care about having installed. For example, you might try

cabal install cabal-dev haskell-platform # or
cabal install cabal-dev async cgi fgl GLUT haskell-src html HTTP HUnit mtl network OpenGL parallel parsec QuickCheck random regex-base regex-compat regex-posix split stm syb text transformers vector xhtml zlib

Or, if you just want to prevent certain packages from being rebuilt, you can use the installed constraint as in cabal install cabal-dev --constraint "haskell-platform installed".