Skip to content

An opinionated pre-built Dev Container for Haskell (which includes HLS, Cabal, Stack, a debugger, local Hoogle and useful extensions).

License

Notifications You must be signed in to change notification settings

marijnvanwezel/haskell-dev-env

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A development container for Haskell

This is an opinionated pre-built Dev Container for Haskell (GHC 9.8.4 LTS).

GIF showing the development container in use

Features

The development container has the following features:

  • Pre-configured Cabal, Stack and HLS: Cabal, Stack and HLS come pre-installed and pre-configured.
  • Pre-installed development tools: The development container comes with a number of generic (Git, Neovim, SSH, etc.) and Haskell-specific (ormolu, implicit-hie, retrie, etc.) development tools pre-installed.
  • Integrated GHCi: The development container comes with an integrated GHCi shell.
  • Offline support: Hoogle and Hackage are included locally in the container, meaning you do not need an internet connection to find definitions or read documentation.

To open the integrated GHCi shell, press the yellow lambda symbol in the top-right corner. To search Hoogle, press Alt + Shift + H.

Using with Visual Studio Code

Follow the steps below to use the Dev Container with Visual Studio Code:

  1. Follow the Getting Started instructions to configure Visual Studio Code and Docker for use with Dev Containers;
  2. Copy the .devcontainer folder in this repository to the root of your project;
  3. Reload the project by opening the command palette (Ctrl + Shift + P or Cmd + Shift + P) and executing the command >Reload Window or by closing and re-opening Visual Studio Code;
  4. Click Reopen in Container when Visual Studio Code prompts you (see image below), or by opening the command palette (Ctrl + Shift + P or Cmd + Shift + P) and executing the command >Dev Containers: Reopen in Container (downloading the image initially make take a while).

How does it work

Visual Studio Code supports Dev Containers (i.e. using a Docker image as a development environment). It automates the hassle of setting up a proper development environment.

Troubleshooting

This section lists some common problems, and possible ways to fix these problems. If you encounter an issue not listed here, or if the fixes listed do not work for you, please open an issue.

  • Definitions from other files are not found.
    • Try running stack install in the project directory.
  • Definitions from dependencies are not found.
    • Try restarting Visual Studio Code.
  • Stuck on Processing ../...
    • Try running stack build in the project directory.
  • Code completion and/or checking is not working.
    • Try restarting Visual Studio Code.
    • Try running stack install in the project directory.
  • Something else does not work.

Installed software

The container comes with the following (relevant) software pre-installed:

The following packages come pre-installed:

  • fsnotify - cross platform library for file creation, modification, and deletion notification;
  • haskell-dap - Haskell implementation of the DAP interface data;
  • ghci-dap - a GHCi with DAP machine interface;
  • haskell-debug-adapter - a debug adapter for Haskell debugging system;
  • hlint - gives suggestions on how to improve your source code;
  • apply-refact - perform refactorings specified by the refact library;
  • retrie - a tool for codemodding Haskell;
  • hoogle - a Haskell API search engine;
  • ormolu - a formatter for Haskell source code;
  • implicit-hie - auto-generate a Stack or Cabal multi-component hie.yaml file.

Following VSCode extensions are automatically installed after container is started:

About

An opinionated pre-built Dev Container for Haskell (which includes HLS, Cabal, Stack, a debugger, local Hoogle and useful extensions).

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Dockerfile 100.0%