ENH use better formatter for haskell

This commit is contained in:
Nathan Dwarshuis 2023-01-01 13:37:24 -05:00
parent 51c6b0bd98
commit 55e04349eb
1 changed files with 11 additions and 6 deletions

View File

@ -773,9 +773,13 @@ Most languages have a plugin/command to make their code "look pretty" (usually o
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package format-all (use-package format-all
:straight t) :straight t
:hook ((format-all-mode . format-all-ensure-formatter))
:config
(setcdr (assoc "Haskell" format-all-default-formatters) '(fourmolu)))
(delight 'format-all-mode "α" "format-all") (delight 'format-all-mode "α" "format-all")
#+end_src #+end_src
** parenthesis matching ** parenthesis matching
This color-codes matching parenthesis. Enable pretty much everywhere. This color-codes matching parenthesis. Enable pretty much everywhere.
@ -1076,7 +1080,6 @@ I have also found this to be much simpler and conflicting with other packages su
;; local completions in 'where' and 'let' clauses ;; local completions in 'where' and 'let' clauses
'((company-capf company-dabbrev-code)))) '((company-capf company-dabbrev-code))))
(use-package haskell-mode (use-package haskell-mode
:straight t :straight t
:hook ((haskell-mode . origami-mode) :hook ((haskell-mode . origami-mode)
@ -1088,14 +1091,16 @@ I have also found this to be much simpler and conflicting with other packages su
(haskell-mode . interactive-haskell-mode) (haskell-mode . interactive-haskell-mode)
(haskell-mode . nd/init-haskell-company) (haskell-mode . nd/init-haskell-company)
;; camelcase is defacto for haskell ;; camelcase is defacto for haskell
(haskell-mode . subword-mode)) (haskell-mode . subword-mode)
;; don't use haskell-mode's builtin stylish plugin for formatting
(haskell-mode . format-all-mode))
:config :config
(setq haskell-interactive-popup-errors nil (setq haskell-interactive-popup-errors nil
;; we use stack...which counterintuitively means we set the ;; we use stack...which counterintuitively means we set the
;; cabal build command to be stack ;; cabal build command to be stack
haskell-compile-cabal-build-command "stack build" haskell-compile-cabal-build-command "stack build"
;; use stylish (requires the stylish binary somewhere in $PATH) ;; don't use stylish
haskell-stylish-on-save t haskell-stylish-on-save nil
;; use some handy suggestions ;; use some handy suggestions
haskell-process-suggest-remove-import-lines t haskell-process-suggest-remove-import-lines t
haskell-process-auto-import-loaded-modules t haskell-process-auto-import-loaded-modules t
@ -1136,7 +1141,7 @@ Dhall is a functional/typed configuration language (bout time).
:straight t :straight t
:mode "\\.dhall\\'" :mode "\\.dhall\\'"
:config :config
(setq dhall-type-check-inactivity-timeout 5)) (setq dhall-type-check-inactivity-timeout 1))
(defun nd/dhall-toggle-type-check () (defun nd/dhall-toggle-type-check ()
"Turn dhall type checking on/off." "Turn dhall type checking on/off."