lang/haskell: add intero support #158

To use dante instead, change `haskell` to `(haskell +dante)` in
~/.emacs.d/init.el.
This commit is contained in:
Henrik Lissner 2017-08-08 19:14:58 +02:00
parent d173ae1ed8
commit 56382f1215
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
4 changed files with 55 additions and 15 deletions

View file

@ -0,0 +1,13 @@
;;; lang/haskell/+dante.el -*- lexical-binding: t; -*-
(def-package! dante
:after haskell-mode
:init
(add-hook! 'haskell-mode-hook #'(dante-mode interactive-haskell-mode))
:config
(unless (executable-find "cabal")
(warn "haskell-mode: couldn't find cabal")
(remove-hook 'haskell-mode-hook #'dante-mode))
(add-hook 'dante-mode-hook #'flycheck-mode))

View file

@ -0,0 +1,21 @@
;;; lang/haskell/+intero.el -*- lexical-binding: t; -*-
(def-package! intero
:commands intero-mode
:init
(add-hook 'haskell-mode-hook #'intero-mode)
:config
(unless (executable-find "stack")
(warn "haskell-mode: couldn't find stack, disabling intero")
(remove-hook 'haskell-mode-hook #'intero-mode))
(add-hook! 'intero-mode-hook #'(flycheck-mode eldoc-mode))
(set! :popup "^intero:backend:" :regex t :size 12)
(set! :jump :definition #'intero-goto-definition))
(def-package! hindent
:commands hindent-mode
:init
(add-hook 'haskell-mode-hook #'hindent-mode))

View file

@ -17,21 +17,21 @@
(map! :map inf-haskell-mode-map "ESC ESC" #'doom/popup-close)))
(def-package! dante
:after haskell-mode
:config
(if (executable-find "cabal")
(add-hook! 'haskell-mode-hook
#'(flycheck-mode dante-mode interactive-haskell-mode))
(warn "haskell-mode: couldn't find cabal")))
(def-package! company-ghc
:when (featurep! :completion company)
:after haskell-mode
:init
(add-hook 'haskell-mode-hook #'ghc-comp-init)
:config
(set! :company-backend 'haskell-mode #'company-ghc)
(setq company-ghc-show-info 'oneline)
(if (executable-find "ghc-mod")
(add-hook 'haskell-mode-hook #'ghc-comp-init)
(warn "haskell-mode: couldn't find ghc-mode")))
(set! :company-backend 'haskell-mode #'company-ghc)
(warn "haskell-mode: couldn't find ghc-mode")
(remove-hook 'haskell-mode-hook #'ghc-comp-init))
(setq company-ghc-show-info 'oneline))
;;
(if (featurep! +dante)
(load! +dante)
(load! +intero))

View file

@ -2,7 +2,13 @@
;;; lang/haskell/packages.el
(package! haskell-mode)
(package! dante)
(when (featurep! :completion company)
(package! company-ghc))
;;
(cond ((featurep! +dante)
(package! dante))
(t
(package! intero)
(package! hindent)))