Skip to content

Instantly share code, notes, and snippets.

@creichert
Last active October 3, 2018 23:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creichert/908e3f90eb79e1f6e665e8dd6c538c43 to your computer and use it in GitHub Desktop.
Save creichert/908e3f90eb79e1f6e665e8dd6c538c43 to your computer and use it in GitHub Desktop.
Toggle the haskell-process-type between Stack & Cabal in haskell-mode for Emacs
;; Toggle the haskell-mode haskell-process-type variable between
;; cabal and stack
;;
;; https://stackoverflow.com/a/27385914/3066608
(defvar haskell-process-use-ghci nil)
(defun haskell-process-toggle ()
"Toggle GHCi process between cabal and ghci"
(interactive)
(if haskell-process-use-stack-ghci
(progn (setq haskell-process-type 'cabal-repl)
(setq haskell-process-use-stack-ghci nil)
(message "Using cabal repl"))
(progn (setq haskell-process-type 'stack-ghci)
(setq haskell-process-use-stack-ghci t)
(message "Using Stack GHCi"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment