Emacs haskell-mode

I set about installing emacs and its haskell-mode based on emacs-haskell-tutorial. But this is what worked for me. This is only part of the process and I will add any new information I come across.

Eval: (find-file user-init-file)

Press Enter. It loads my .emacs file if it is there.Create one and save it if it isn’t there.


This section should be enough if there is no proxy.

(require ‘package)
(add-to-list ‘package-archives
‘(“melpa-stable” . “http://stable.melpa.org/packages/”) t)

Corporate proxy

If there is a proxy add this section too.

(setq url-proxy-services
‘((“no_proxy” . “^\\(localhost\\|10.*\\)”)
(“http” . “proxy.cognizant.com:6050”)
(“https” . “proxy.cognizant.com:6050”)))

(setq url-http-proxy-basic-auth-storage
(list (list “proxy.cognizant.com:6050”
(cons “Credentials !”
(base64-encode-string “user:password”)))))


Cabal seems to be the package manager for Haskell libraries.

I had cabal.exe locally and realized it is not the correct way.

D:\Frege>..\Downloads\cabal update
Downloading the latest package list from hackage.haskell.org
Note: there is a new version of cabal-install available.
To upgrade, run: cabal install cabal-install

D:\Frege>ghc-pkg list Cabal
D:/Haskell Platform/7.10.3\lib\package.conf.d:

D:\Frege>..\Downloads\cabal install happy
cabal: The program ghc version >=6.4 is required but it could not be found.

So I installed Haskell Platform and added the bin folder to the PATH.

Everything worked after that.

D:\Frege>cabal install cabal-install
Resolving dependencies…
Downloading cabal-install-…
Configuring cabal-install-…
Building cabal-install-…
Linking dist\build\cabal\cabal.exe …
Installing executable(s) in C:\Users\476458\AppData\Roaming\cabal\bin
Installed cabal-install-

cabal: no command given (try –help)

D:\Frege>cabal –version
cabal-install version
using version of the Cabal library

HaskellPlatform-7.10.3-x86_64-setup.exe InstallCert.java
InstallCert$SavingTrustManager.class emacs-24.5-bin-i686-mingw32
InstallCert.class emacs-24.5-bin-i686-mingw32.zip

D:\Frege>cabal update
Downloading the latest package list from hackage.haskell.org

D:\Frege>cabal install happy
Resolving dependencies…
Downloading happy-1.19.5…
[1 of 1] Compiling Main ( C:\Users\476458\AppData\Local\Temp\cabal-t
Linking dist\build\happy\happy.exe …
Installing executable(s) in C:\Users\476458\AppData\Roaming\cabal\bin
Installed happy-1.19.5


Not yet sure if the mode is effective. I don’t see any syntax highlighting yet.


Update : Now it looks better


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: