From 3860b4913c97ac90a834c0266fa5ad0f3bc58fc6 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Tue, 24 Mar 2020 20:39:22 -0400 Subject: [PATCH] REF clean up haskell section --- etc/conf.org | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/etc/conf.org b/etc/conf.org index 40fb89b..ff576f6 100644 --- a/etc/conf.org +++ b/etc/conf.org @@ -837,7 +837,7 @@ The major mode package =haskell-mode= is quite comprehensive and has most of wha - type checking/insertion/annotation - function info -Since most of these need a GHC session to run properly, just run =haskell-process-load-or-reload= in one of the project files. +Since most of these need GHCi to run properly, I added a hook to load haskell source into GHCi when opened. I have also found this to be much simpler and conflicting with other packages such as =dante= and =intero= (and probably =haskell-ide-engine= and friends). #+BEGIN_SRC emacs-lisp @@ -849,7 +849,7 @@ I have also found this to be much simpler and conflicting with other packages su '((company-capf company-dabbrev)))) (defun nd/haskell-load-maybe () - "Prompts user to turn on `auto-fill-mode'." + "Prompts user to load haskell source to GHCi." (when (y-or-n-p "Load Haskell source into GHCi? ") (haskell-process-load-or-reload))) @@ -858,18 +858,25 @@ I have also found this to be much simpler and conflicting with other packages su :hook ((haskell-mode . origami-mode) (haskell-mode . company-mode) (haskell-mode . haskell-indentation-mode) + ;; this enables better integration with the running GHCi process (haskell-mode . interactive-haskell-mode) (haskell-mode . nd/init-haskell-company) - (haskell-mode . nd/haskell-load-maybe)) + (haskell-mode . nd/haskell-load-maybe) + ;; camelcase is defacto for haskell + (haskell-mode . subword-mode)) :config (setq haskell-interactive-popup-errors nil ;; we use stack...which counterintuitively means we set the ;; cabal build command to be stack haskell-compile-cabal-build-command "stack build" + ;; use stylish (requires the stylish binary somewhere in $PATH) haskell-stylish-on-save t)) ;; this minor mode name is long and unnecessary (delight 'interactive-haskell-mode nil "haskell") + +;; unnecessary to see on the modeline +(delight 'subword-mode nil "subword") #+END_SRC **** hlint This is an additional syntax checker and requires the =hlint= binary (install through stack). @@ -877,12 +884,6 @@ This is an additional syntax checker and requires the =hlint= binary (install th (with-eval-after-load 'haskell (flycheck-add-next-checker 'haskell-stack-ghc '(t . haskell-hlint))) #+END_SRC -**** camelCase -The defacto style for haskell mandates camelcase, so use subword mode. -#+BEGIN_SRC emacs-lisp -(add-hook 'haskell-mode-hook #'subword-mode) -(delight 'subword-mode nil "subword") -#+END_SRC **** helper functions Other helper functions that make haskell even more fun. #+BEGIN_SRC emacs-lisp