Frage

I've downloaded the binary distribution for GHC 7.8-RC1. It did a nice job installing separate ghc/ghci/ghc-pkg binaries for 7.6 and 7.8. I can launch ghci and do wonderful things, and I can compile simple hello world files, but if I try to do anything that uses any libraries, etc it doesn't find them (unsurprisingly).

I've done some googling and it doesn't seem obvious how I would go about messing with larger projects compiled with 7.8, and even more strangely I don't find others asking the question. Maybe I've missed something obvious? I'm a Haskell noob, but there are some things that require 7.8 that I'm keen to experiment with.

I'm running OS X Mavericks with Xcode 5 which I understand causes some trouble, but I've worked around the things so far by installing gcc 4.8 and referencing it as necessary.

War es hilfreich?

Lösung

I think if you just set your PATH to pick up the ghc78 binaries you can just use cabal (from an existing Haskell Platform install.)

cabal already segregates packages by ghc version, so it won't use any packages built with older versions of ghc.

For iOS, see this post for a build of ghc rc1:

http://www.haskell.org/pipermail/ghc-devs/2014-February/004004.html

Here is what is working for me. I am using Lion, but the same process should work under Mavericks.

cd /tmp
wget http://www.haskell.org/ghc/dist/7.8.1-rc1/ghc-7.8.20140130-x86_64-apple-darwin-lion.tar.bz2
tar jxf ghc-7.8.20140130-x86_64-apple-darwin-lion.tar.bz2
cd ghc-7.8.20140130
mkdir $HOME/ghc78
./configure --prefix=$HOME/ghc78
make install

export PATH="$HOME/ghc78:$PATH"
cabal update
cabal install dimensional-tf-0.3

This test the new negative literal syntax (see this recent blog post)

$ ghci -XNegativeLiterals
GHCi, version 7.8.20140130: http://www.haskell.org/ghc/  :? for help
Prelude> import Numeric.Units.Dimensional.TF.Prelude
...> -123.56 *~ kilo meter
Loading ...
...
Loading package numtype-tf-0.1.2 ... linking ... done.
Loading package dimensional-tf-0.3 ... linking ... done.
-123560.0 m
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top