How to set up a Haskell project

Installation and set up of Haskell Stack on a new machine

This week I've started reading Haskell Programming From First Principles and authors recommend using Stack I went through installing it on two machines. Unfortunately, the docs are a little wordy so I've made a post that will contain only steps that were relevant for me.

Generic setup #

  1. curl -sSL https://get.haskellstack.org/ | sh
  2. stack new helloworld
  3. cd helloworld
  4. If you follow the book then jump to Custom setup for the book
  5. stack setup
  6. stack build
  7. stack exec helloworld-exe (notice added -exe)

Custom setup for the book #

  1. Change stack.yml:
# from
resolver: lts-15.1
packages:
- .
# to (book version)
resolver: lts-13.24
packages: []
  1. stack setup
  2. stack ghci
    • stack build and stack exec helloworld-exe won't work for you.

Other resources #



Share on Hacker News
Share on LinkedIn


← Home


Want to learn more?

Sign up to get a digest of my articles and interesting links via email every month.

* indicates required

Please select all the ways you would like to hear from Krzysztof Kula:

You can unsubscribe at any time by clicking the link in the footer of my emails.

I use Mailchimp as a marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.