Emacs haskell-mode
March 29, 2016 Leave a comment
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)
(package-initialize)
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
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-installD:\Frege>ghc-pkg list Cabal
D:/Haskell Platform/7.10.3\lib\package.conf.d:
Cabal-1.22.5.0D:\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-1.22.9.0…
Configuring cabal-install-1.22.9.0…
Building cabal-install-1.22.9.0…
Linking dist\build\cabal\cabal.exe …
Installing executable(s) in C:\Users\476458\AppData\Roaming\cabal\bin
Installed cabal-install-1.22.9.0D:\Frege>cabal
cabal: no command given (try –help)D:\Frege>cabal –version
cabal-install version 1.22.6.0
using version 1.22.5.0 of the Cabal libraryD:\Frege>ls
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.zipD:\Frege>cabal update
Downloading the latest package list from hackage.haskell.orgD:\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
Haskell-mode
Not yet sure if the mode is effective. I don’t see any syntax highlighting yet.
Update : Now it looks better