I've been trying to learn Haskell the last couple of days so it was finally time to setup my environment. Thus, I installed Haskell Platform and cabal.
My editor is emacs and my OS is Windows.
I downloaded the ghc-mod's master branch from github and using cabal I installed the dependencies and then built the project. Everything went fine and the executable seems to work.
Commands like ghc-mod --version
or ghc-mod boot
work as expected.
Then, I installed haskell-mode on emacs and modified .emacs to use ghc. But when I tried to open a Haskell file, emacs froze saying "Initializing...".
What is the problem?
GHC version: 7.10.2 cabal version: 1.22.6.0 using version 1.22.4.0 of the cabal library ghc-mod version: 5.3.0.0 compiled by GHC 7.10.2
Edit 1: 16/8/2015 11:10
Here are the lines I added to my .emacs
:
; haskell-mode
(add-hook 'haskell-mode-hook 'haskell-indentation-mode)
; ghc-mod for haskell
; I added to list path to ghc elisp file because I read somewhere that that's
; better than installing it from MELPA. I DID try to install it from melpa
; though. Didn't solve anything.
(add-to-list `load-path "~/cabal/x86_64-windows-ghc-7.10.2/ghc-mod-5.3.0.0/elisp")
(autoload 'ghc-init "ghc" nil t)
(autoload 'ghc-debug "ghc" nil t)
(add-hook 'haskell-mode-hook (lambda () (ghc-init)))
Emacs freeze when I try to open a haskell file for the first time. So I guess it stacks in an infinite loop inside ghc-init()
.
Edit 2: 16/8/2015 21:16
Output from ghc-debug
is here
I opened an issue on
ghc-mod
github repo and they solved the issue.You can view the solution in this issue's comments.