Glasgow (Glorious) Haskell Compiler

install ghc package from your OS

sudo apt-get install ghc alex happy

clone the latest LTS release

git clone --branch=ghc-8.4.4-release --recurse-submodules git://

set some safe defaults for Clang (notice no explicit -pthread flag

export CC=clang

export CFLAGS="-Wformat -Wformat-security -Werror=format-security \
    -fstack-protector-strong -fstack-protector-all --param ssp-buffer-size=4 \
    -Wstrict-aliasing=2 -fno-strict-aliasing \
    -ffunction-sections -fdata-sections \
    -m64 -march=native -mtune=native -O3 \
    -fPIC \

export LDFLAGS="-L/usr/local/lib \
    -rtlib=compiler-rt \
    -fPIC \
    -Wl,--gc-sections -Wl,--as-needed \
    -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack"


cd ghc
./boot && ./configure --prefix=/usr/local --with-ghc=/usr/bin/ghc
make -s all
sudo make -s install

install stack binary (the idiotic way)

wget -qO- | sh

to build it from the sources you need guess what?

git clone
cd stack
stack setup && stack build

setting up some sane defaults in .stack/config.yaml

system-ghc: true

and in .stack/global-project/stack.yaml

resolver: lts-12.16

then run

stack update

Make sure everything works correctly (we need the cabal binary, of course)

stack install cabal-install

then run

cabal update

A documentation search tool

stack install hoogle

REPL wrapper for editors

stack install intero


stack install hlint


stack install hdevtools hindent

Unnecessary wrapping (3 layers!)

stack ghci --with-ghc intero

Editor support

Language Server

git clone --recurse-submodules git://
cd haskell-ide-engine
stack install

it has ghc-mod built in


(package-install 'lsp-mode)
(package-install 'lsp-ui)
(package-install 'lsp-haskell)
(package-install 'haskell-mode)
(package-install 'intero)


cd ~/.local/share/nvim/plugged/
git clone git://
cd LanguageClient-neovim
cargo install --force

then in .config/nvim/init.vim

let g:LanguageClient_autoStart = 1

let g:LanguageClient_serverCommands = {
    \ 'haskell': ['hie-wrapper']
Last modified 3 years ago Last modified on Nov 12, 2018, 1:29:39 PM
Note: See TracWiki for help on using the wiki.