Skip to content

Instantly share code, notes, and snippets.

@gpampara
Last active August 29, 2015 14:23
Show Gist options
  • Save gpampara/00616c89e4c33f6deed6 to your computer and use it in GitHub Desktop.
Save gpampara/00616c89e4c33f6deed6 to your computer and use it in GitHub Desktop.
ghc-mod master and GHC 7.10.1
1. After installing GHC, checkout ghc-mod (https://github.com/kazu-yamamoto/ghc-mod) and build master using 7.10.1
2. Update your PATH to include the locaiton of the built 'ghc-mod' and 'ghci-mod' binaries
3. Update your emacs config to load up PATH to correctly locate ghc-mod. I needed to add some elisp to my emacs config
;; Some shell variable magic
(let ((path (shell-command-to-string ". ~/.zshrc; echo -n $PATH")))
(setenv "PATH" path)
(setq exec-path
(append
(split-string-and-unquote path ":")
exec-path)))
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
4. Load the new elisp from the ghc-mod repo and remove any older ghc-mod packages out of emacs
(progn (cd "/path/to/ghc-mod/elisp/") (normal-top-level-add-subdirs-to-load-path))
(if (fboundp 'normal-top-level-add-subdirs-to-load-path)
(let* ((my-lisp-dir "/path/to/ghc-mod/elisp/")
(default-directory my-lisp-dir))
(setq load-path (cons my-lisp-dir load-path))
(normal-top-level-add-subdirs-to-load-path)))
5. Ensure that ghc-mod is loaded
That should be it :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment