Setting up Haskell in VS Code with Stack and the IDE Engine

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 --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



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store