haskellemacshaskell-mode

Switch haskell-process-type between cabal-repl and ghci


Can I switch the haskell-process-type on during an alive haskell session or when starting a new session?


Solution

  • Yes, just type the following in a buffer and C-x C-e it afterwards (assuming cabal-repl is your default).

    (setq haskell-process-type 'ghci)
    

    In my .emacs I actually have this to make this easy, since I do this often:

    (define-key haskell-mode-map (kbd "C-c h t") 
      (lambda () (interactive)
        (progn
          (setq haskell-process-type 'ghci)
          (message "Now in ghci mode."))))
    

    Another C-c C-l will then load your interactive buffer with the correct mode.

    EDIT: Using haskell-mode-map now.