usethetypes#0: Haskell Stack

In this episode of usethetypes, I’ll show you how to install
Haskell Stack from scratch on a clean Linux development
machine. Stack is the Haskell build tool I will use for many of my other
videos and so this setup step will be an important prerequisite for most
future tutorials. After following this video, you’ll be able to build
and run a simple “Hello World” program written in Haskell. You’ll also
be set up to get stuck into my future videos.

Notes

I haven’t done much to the operating system except install updates,
clean up the desktop and install my favourite web browser

Step 1: Install Haskell Stack

Full installation instructions for Haskell Stack are available on its
web site. To view these, open up your web browser and visit https://haskellstack.org/. For Unix-like operating systems, there are two main commands described which are largely equivalent: one using curl and the second using wget. We’ll use the wget variant since this command is most likely to be present on a clean installation of Ubuntu 18.04:

wget -qO- https://get.haskellstack.org/ | sh

The wget command will need to run some commands as root and so will prompt you for your password via sudo.

Once that has finished, you’ll notice that the output references a .local/bin directory. This is a user-wide location where Stack will copy executables when using the stack install command. This is a useful location to have available at all times, so we should add this path to the PATH environment variable in your bash configuration file: