Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Frontend

Daniel Gröber edited this page Jan 19, 2017 · 9 revisions

Frontend specific installation instructions

Emacs (native frontend)

Using the stable version

The Emacs front-end is available from stable MELPA. The stable version should always be compatible with the latest version of ghc-mod from hackage which is not true for plain MELPA!

You can also use a git checkout of the ghc-mod source repository as your source for the Elisp code if you prefer.

With ELPA

To use stable MELPA add this to your .emacs:

(require 'package)
(add-to-list 'package-archives
	     '("melpa" . "http://melpa-stable.milkbox.net/packages/"))
(package-initialize)

(add-hook 'haskell-mode-hook (lambda () (ghc-init)))

(See also http://www.emacswiki.org/emacs/ELPA)

With this configuration you can install the Emacs front using:

M-x package-refresh-contents RET
M-x package-install RET ghc RET

Note: the ELPA package is called ghc, not ghc-mod

Without ELPA

Obtain the ghc-mod source somehow and then add this to your .emacs

(add-to-list 'load-path "<wherever>/ghc-mod/elisp")
(setq ghc-debug t) ; enable debug logging
(autoload 'ghc-init "ghc" nil t)
(autoload 'ghc-debug "ghc" nil t)
(add-hook 'haskell-mode-hook (lambda () (ghc-init)))

Make sure the source matches the version of the ghc-mod executables you installed otherwise you will run into all sorts of trouble.

You can check this by looking at the ghc-version variable:

M-x describe-variable RET ghc-version RET

This value should match the output of the following command:

ghc-mod --version

Vim (ghcmod-vim)

TODO

https://github.com/eagletmt/ghcmod-vim https://github.com/eagletmt/neco-ghc

Atom (ide-haskell+haskell-ghc-mod)

To use ghc-mod with Atom you should install ide-haskell and the companion haskell-ghc-mod. Installation instructions can be found here: https://github.com/atom-haskell/ide-haskell.

Clone this wiki locally