3

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

TheCrafter
  • 1,909
  • 2
  • 23
  • 44
  • 1
    Not enough info, I'd guess, but maybe it will ring a bell for someone familiar with `ghc*`. Otherwise, try providing a specific, step-by-step recipe to reproduce the problem, including all steps, starting from `emacs -Q`. – Drew Aug 16 '15 at 02:32
  • @Drew It may seem incomplete but I really don't have any more info to provide. I just installed `ghc-mod` and when I try to open a Haskell file it just freezes. I'll add to my post the lines I added to my `.emacs` when I wanted to add `ghc-mod`. – TheCrafter Aug 16 '15 at 08:09
  • FYI that instance of `\`load-path` would conventionally use a regular `'` quote than a backquote. (It seems like a standard backquote, though, so functionally that's not actually a problem here.) – phils Aug 16 '15 at 09:36
  • @phils Thanks for the tip. But yeah, that's not the problem here. load path works correctly. – TheCrafter Aug 16 '15 at 09:39

1 Answers1

0

I opened an issue on ghc-mod github repo and they solved the issue.

You can view the solution in this issue's comments.

TheCrafter
  • 1,909
  • 2
  • 23
  • 44