How to set up a haskell programming workspace

A good Haskell workspace is boring on purpose: one compiler version, one project folder, an editor that reports errors as you type, and a terminal you can reach without moving your hands. Set it up once, then stop rearranging it. The setup below takes an afternoon and will serve you for years.

One toolchain, installed once

Use GHCup to install the compiler and the build tool together, and let it manage the versions. Installing pieces separately is how people end up with a compiler the build tool cannot find.

  • Put the toolchain on your normal user account, not in a system directory.
  • Note the exact compiler version you installed so you can match library docs.
  • Check that both the compiler and the REPL run from a fresh terminal.

Before adding anything else, compile and run a single file. A one-line program that prints a string is enough to prove the path works.

Separate scratch work from projects

Keep two places: a scratch directory for experiments, where nothing matters, and a projects directory, where each project has its own folder and its own version control. Scratch code should never need a build file, and project code should never live in the scratch folder.

This separation sounds fussy until the first time you break a build while experimenting. Then it saves an evening.

Configure the editor for fast feedback

Install a Haskell language server so the editor shows types and errors inline. Then set up formatting on save, which catches layout problems immediately, and a shortcut that reloads the REPL without leaving the file.

  • Turn on bracket matching and visible whitespace.
  • Use a monospaced font at a size you can read for an hour.
  • Keep one terminal tab dedicated to the REPL and one for shell commands.

Comfort, lighting, and keeping it small

Long error messages mean long stretches of reading, so a taller monitor or a larger font does more for you than an expensive keyboard. Add a second surface for notes; writing type signatures by hand is often faster than typing them into a comment.

Lighting matters more than most people admit. Putting a lamp beside the screen rather than behind it reduces the reflections that make small punctuation hard to read, and Haskell is a language where punctuation carries meaning.

Two terminals, one editor, one notes file, and one browser window with documentation. Closing everything else is a working technique, not a preference. Every additional panel is something to glance at instead of thinking.

Checklist before you begin a session

Open the project folder, start the REPL, load the module you are working on, and write one failing test or one scratch expression. That two-minute ritual tells you the build is healthy before you spend an hour assuming it is.

Boring, repeatable, and fast to restart: that is the whole brief. Build the habit once and your attention stays on types and functions rather than on tooling.