Skip to content

Instantly share code, notes, and snippets.

@jameslmartin
Last active August 29, 2015 14:00
Show Gist options
  • Save jameslmartin/245f905b4d5327e3f746 to your computer and use it in GitHub Desktop.
Save jameslmartin/245f905b4d5327e3f746 to your computer and use it in GitHub Desktop.
Explorations with Haskell

Explorations in Haskell as a platform

Note: I'm pretty new to Haskell, I've only experimented with it during COMP 524, and written some pretty basic functions.

So I decided I wanted to try to throw together a quick web server together with Haskell, but it's been a small disaster setting up the tools necessary.

OS: Ubuntu 12.10

The first thing I did was create a folder for my experiment, under ~/Documents/Code/haskell I then ran sudo apt-get install haskell-platform to get ghci and cabal, Haskell's package manager. I then wanted to create cabal sandbox, so I ran cabal sandbox init and this was the beginning of a two-hour struggle...

As it turns out, the out-of-the-box Haskell platform ships with cabal v1.14, and the sandboxing was added in v1.18. The current, stable version of cabal, mind you, is v1.20. So, I ran: cabal install cabal cabal-install which seems to me like cabal bootstrapping itself, similar to npm's bootstrap updater. After cabal updated, I attempted to initialize the sandbox again, but I received the same error as before.

To cut to the chase, I had to prepend the path to the cabal folder, located at ~/.cabal/ to my path variable.

So to walk through what I've done so far:
sudo apt-get install haskell-platform
cabal install cabal cabal-install
PATH='~/.cabal/bin:$PATH'

This was after breaking symlinks, purging broken Haskell packages, and uninstalling/reinstalling at least twice...

So if you get this far, make sure you test your version of cabal by running: cabal -V

If you see version 1.18 or higher, you're good to go. So finally, I got the sandbox up. But this was not the end of my struggles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment