It’s recommended to first read the whole blog post to understand what is needed, and then to proceed with specific list items.
- Make sure you’re using at least Cedar stack on Heroku. To create a new Cedar application use: “heroku create –stack cedar”.
- Create a Virtual Machine with Ubuntu 10.04 Lucid Lynx (64 bit). As of March 2012 Heroku uses Linux servers with glibc version 2.11.1, same as Ubuntu 10.04. Also: Heroku uses 64 bit architecture, hence the Virtual Machine has to be 64 bit too.
- On Virtual Machine: The GHC version in Ubuntu packages is outdated. Download the GHC binary from http://haskell.org/ghc (I picked 7.04) and install it.
- On Virtual Machine: download the Haskell Platform source package (http://haskell.org/platform), compile and install it.
- On Virtual Machine: Install necessary Cabal packages, compile the project with “ghc Main.hs -o tfoo”.
- Add the resulting binary to the github repository.
That’s it! Tfoo is ready for Heroku deployment. However, if you’re trying to deploy a different project, make sure that this checklist applies too:
- The project’s binary accepts port as a command line parameter.
- You have to add a Procfile to the repository. It should look like this.
- The project resembles a technology supported by Heroku. E.g. it has a Gemfile and Gemfile.lock (to look like a Ruby project), or has package.json (in a node-like fashion).
- In case other issues appear (after all your project may use different libraries; Tfoo doesn’t even use a database!), please browse helpful links section below.
Suggestions? Improvements? Contact me via my GitHub profile.
Post Scriptum: Why another Haskell to Heroku guide?
Haskell needs more success stories. Also there’s great need for up-to-date documentation. This article contains a very specific checklist that shows how one simple project can be made visible to everybody with minimum effort. Hope it will make more such Haskell projects appear!
Thanks @szemek for feedback and more details!