+;;; init-haskell --- Haskell config
+
+;;; Commentary:
 ;; Based on https://github.com/purcell/emacs.d/blob/8208151ab23cdcaa7b1027d16d8bd108a3b0dfd6/lisp/init-haskell.el
+
+;;; Code:
 
 (require-package 'haskell-mode)
 

    (add-to-list
     'compilation-error-regexp-alist alias)))


(provide 'init-haskell)

      (unless (flycheck-has-current-errors-p 'error)
        ad-do-it))

    ;; (require 'flycheck-hdevtools)
    ))

(dolist (hook '(eldoc-mode turn-on-haskell-font-lock interactive-haskell-mode))
  (add-hook 'haskell-mode-hook hook))


;; ===== DOCS =====

(dolist (hook '(haskell-mode-hook inferior-haskell-mode-hook haskell-interactive-mode-hook))
  (add-hook hook 'turn-on-haskell-doc)
  (add-hook hook (lambda () (subword-mode +1)))
  (add-hook hook (lambda () (eldoc-mode 1))))

;; (add-hook 'haskell-interactive-mode-hook 'sanityinc/no-trailing-whitespace)


;; ===== INTERACTION =====

(after-load 'haskell (diminish 'interactive-haskell-mode " IntHS"))

(add-auto-mode 'haskell-mode "\\.ghci\\'")

