Dante is a fork of Intero mode. It steals many good ideas from Intero, but it aims for light weightedness (see below for a detailed comparison).
Feature | Command | Keybinding |
---|---|---|
Flycheck type checking | flycheck-mode | |
Type of selection | dante-type-at | C-c . |
Info at point | dante-info | C-c , |
Apply Ghc suggestion for error at point | dante-auto-fix | C-c / |
Goto definition | xref-find-definitions | M-. |
Find uses | xref-find-references | M-? |
REPLoid (*) | dante-eval-block | C-c ’ |
Restart | dante-restart |
(*) REPLoid explanation:
You can evaluate code by writing it in a comment of the form
{-> [code to evaluate] -}
and run dante-eval-block.
Example:
example :: [String]
example = ["This is an example", "of", "interactive", "evaluation"]
{-> intercalate " " example
-}
In the above file, if you invoke dante-eval-block
on the line
containing “intercalate”, you’ll get:
{-> intercalate " " example
"This is an example of interactive evaluation"
-}
Turn on Dante in your haskell-mode-hook
. I recommend:
(use-package dante
:ensure t
:commands 'dante-mode
:init
(add-hook 'haskell-mode-hook 'dante-mode)
(add-hook 'haskell-mode-hook 'flycheck-mode))
You may want to be sure not to enable (interactive-haskell-mode)
so
that Dante keybindings are not hidden.
You can activate the hlint checker in addition to the dante checker as follows:
(add-hook 'dante-mode-hook
'(lambda () (flycheck-add-next-checker 'haskell-dante
'(warning . haskell-hlint)))
Use M-x customize-group dante
To the best of my knowledge, here is how Dante compares with Intero:
- Dante has no dependency on “Stack”
- Dante’s Emacs code is about half as long as that of Intero.
- Dante does not depend on custom Haskell code, contrary to intero. Thus, it will if (and only if) GHCi works for your project. (Including via “Stack”).
- Dante supports
xref-find-definitions
andxref-find-references
. - With Dante, Flychecking is optional (yet recommended), whereas Intero demands that you flycheck your code.
- Dante has has a different approach to Haskell evaluation
- Dante offers no support for Hoogle nor eldoc.