Setting up Haskell in VS Code on macOS

Matthew Doig
Nov 20, 2016 · 7 min read
Hmm?!? Where to start?

The Haskell Tool Stack

brew install haskell-stack
stack new my-project
cd my-project
stack setup
code .

From Editor to IDE

Linting Extension

stack install hlint..Copying from /Users/dogwith1eye/.stack/snapshots/x86_64-osx/lts-7.9/8.0.1/bin/hlint to /Users/dogwith1eye/.local/bin/hlint
export PATH=$PATH:~/.local/bin

Language Server

stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 8.6.4
cd ..
git clone https://github.com/haskell/haskell-ide-engine --recurse-submodules
cd haskell-ide-engine
stack ./install.hs hie-8.6.4
stack ./install.hs build-doc-8.6.4

Debugging Extension

cd ../my-project
stack install phoityne-vscode

Testing out the Debugger

stack test...Test suite not yet implemented
stack build
{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
stack install hspec-discover

Now We’re Ready to Learn Haskell

Matthew Doig

Written by

A programmer looking for ways to see the forest instead of the trees.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade