This past weekend, I convinced myself to give Leksah, the Haskell IDE written in Haskell, a try. I’m glad I did. Writing Haskell in it is much more enjoyable than using Notepad++ and WinGHCi side by side. So much more enjoyable that I actually managed to sit down and write something useful!
Installing Leksah on Windows is not hard, but it is easy to mess up, as I found out. Here is what I hope is a step-by-step guide to doing it on Windows 7. Note that this walkthrough assumes you already have GHC installed, probably by installing the Haskell Platform.
- Determine your ghc version by typing “ghc –version” at a command prompt. In my case, it was 7.0.4.
- Download the Leksah binary installer that matches your ghc version. Matching of versions is not optional!
- Run the installer and accept the default installation location. Mine was C:\Program Files (x86)\Leksah\
- Start up Leksah (you can search for it in the Start menu). When you first start up Leksah, you will be asked to provide the path to your cabal packages. This is so Leksah can process your packages into an explorable database.
- Add the packages path into the text field, then click the Add button. You should see the path listed in the path list as confirmation of your selection. My path was C:\Users\MyUserName\AppData\Roaming\cabal\packages. Then click OK.
- Leksah will process your installed packages. This takes a few minutes. If it looks like Leksah performed this processing really quickly/nearly instantly, then double-check that your Leksah installer matches your ghc version. (This was my problem for quite a while.)
- Leksah saves your package data in a .leksah folder in the top level of your user directory. If you delete this folder, Leksah will revert its behavior as if it were freshly installed. This is useful if the guide above doesn’t work for you and you need to debug some stuff but don’t want to endlessly uninstall then reinstall.
And that’s it! If you need help on using Leksah, try this series of youtube videos.