3

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.

Jake Brownson
  • 469
  • 2
  • 9
  • Which libraries are you trying to use? – Code-Apprentice Feb 12 '14 at 02:45
  • Well there are a number of things I'd like to experiment with. I want to try lamdu which is broken w/ 7.6 on OS X, but there's a branch that adds support for 7.7. It has a number of dependencies. I'd also like to experiment w/ the iOS stuff for which I'm not sure which libraries I'll need, and I've been messing w/ some gtk stuff that would be fun to use w/ 7.8 features. I tired to keep the Q more general as I would hope there would be a way to basically set up a separate cabal environment or something as long as the pkg was compatible. – Jake Brownson Feb 12 '14 at 02:49
  • Also try brew install --devel ghc – Jake Brownson Feb 23 '14 at 02:58

1 Answers1

2

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
ErikR
  • 51,541
  • 9
  • 73
  • 124
  • Okay great, I think that's exactly what I was looking for. Also wow negative literals, hadn't seen that! nice! I'll give 'er a go and make the check green if it works :). – Jake Brownson Feb 12 '14 at 04:52
  • 1
    You do not have to mess with `PATH`, just pass `--with-compiler ..../ghc-7.8.1` to `cabal install`. – Joachim Breitner Feb 12 '14 at 09:12