The H2 Wiki


how-i-use-dante

How I use dante

Introduction

Dante is an “Emacs mode for Interactive Haskell” (that is, an IDE) with a high power-to-weight ratio, being easy to configure, reliable and featureful. I will take you on a brief tour of how I use Dante, starting with installation and configuration, demonstrating the features, and explaining how to resolve some typical problems.

Dante works by spawning an interactive ghc process (ghci, cabal repl, stack repl), loading your code in it, and talking to it to find out all sorts of information regarding types, errors, warnings, suggested fixes, and more.

Installation

The most difficult part of setting up dante was learning how to effectively manage Emacs packages. The only sane way that I have found is to use straight.el. It provides some hope that one can define a reproducible package environment. Thus to install dante I do the following.

(straight-use-package 'use-package)
(use-package attrap
  :straight t
  )

(use-package dante
  :straight t
  :after haskell-mode
  :commands 'dante-mode
  :init
  (add-hook 'haskell-mode-hook 'flycheck-mode)
  (add-hook 'haskell-mode-hook 'dante-mode)
  :config
  (flycheck-add-next-checker 'haskell-dante '(info . haskell-hlint))
  )

These are the default install commands from the dante and attrap installation guides, adapted to use straight.el and slightly simplified.

Dante’s features

Problems