EclipseFP The Haskell plug-in for Eclipse
If you are already proficient in installing Eclipse plug-ins, all you need to know is that the Java Development Tools are required and the EclipseFP update site is located in
http://eclipsefp.sf.net/updates and then follow the extra configuration steps. If you don't know what "update site" means, don't worry, just follow the steps right below this text. The current version of EclipseFP is 2.5.6. EclipseFP requires Eclipse 3.7 or above.
Getting Eclipse up and running
If it's the first time that you use Eclipse or install plug-ins, follow this set of instructions:
- You'll need of course a Java Runtime Environment (JRE), version 6 or above. If you need to download it, go to this page.
- Go to the Eclipse download page and get any of the Eclipse bundles. With each of them you will get a different initial set of language support. I recommend going through some Eclipse tutorials and learning about other plug-ins such as EGit and Mylyn.
- Uncompress the archive you just downloaded. A
eclipse folder will be created.
- Inside this folder, you will find an executable called
eclipse. Double-click it to start the Eclipse environment (yes, "installing Eclipse" means uncompressing it somewhere, even on a portable drive).
- The first time you execute Eclipse, you will be asked about a workspace. A workspace is just the folder where your preferences and configurations are stored (you can have different sets of preferences using different workspaces), and where your projects will be created by default. For trying, you can just use the default choice (usually
<your user folder>/workspace).
- Now, let's install EclipseFP. First, on the menu, go to Help > Install New Software....
- In the Available software window that will appear, click the Add... button.
- You will be asked about the details of the update site you want to add. An update site is just a place on the internet where your Eclipse installation can find new plug-ins to install. If you use Linux, the concept is very similar to a repository. The name is not important, but the URL must point to
- The Available software window will show the plug-ins in the EclipseFP repository. Check FP: Haskell support for Eclipse and click Next.
- After clicking Next a few more times (for accepting the licenses), the plug-in will be downloaded and installed.
- You will be asked for an Eclipse restart. After doing it, you can start using EclipseFP by going to Window > Open perspective > Other... and selecting Haskell.
- There is some help for EclipseFP inside the Eclipse help system. Press F1, or choose Help > Help Contents. The help is available under the title Haskell Plug-in User Guide.
- Now, follow the extra configuration steps
Extra configuration steps
If you have GHC installed and in your path (for example, by installing the Haskell Platform or the corresponding package in your Linux distribution), the first time you start EclipseFP you will be prompted to install BuildWrapper and Scion-browser. Just click install to have them downloaded from Hackage and installed.
After that, other message will appear, telling you that EclipseFP is Rebuilding the package database. That operation will be done every time you start EclipseFP. This rebuilding gathers information about changes in your set of installed packages and downloads the corresponding documentation from the internet (or if no internet is present, tries to build it locally). Of course, the first time this is done a lot of information must be downloaded and processed, so it will take some time.
When no message telling about jobs is on your screen, you can start playing with your new shiny EclipseFP :) If for some reason you get an error, check the FAQ or ask in the mailing list.
For some of the features to be available you need to install several additional Haskell programs. The instructions below give you the cabal command to run, but you can also install helper executables from inside EclipseFP (Preferences -> Haskell -> Helper Executables or via the Cabal Packages View). To be more concrete:
- You need to install Hoogle, to search functions or types in your installed packages. To get it, run
cabal install hoogle in a console. The next time EclipseFP starts, it will detect and configure it for use. On Windows, you may need to install some other binaries for hoogle to work: wget, gzip and tar.
- If you want HLint to give suggestions for improving your code, install it running
cabal install hlint. Most HLint suggestions can be automatically applied to your code via Quick Fixes.
- EclipseFP's preferred test framework is HTF. EclipseFP provides wizards to create HTF test-suites and module, and the test runner UI integrates nicely with HTF. You can install it by running
cabal install HTF in a console.
- EclipseFP can also run unit tests created with Test-framework. You can install it running
cabal install test-framework test-framework-quickcheck2 test-framework-hunit (to be able to use QuickCheck and HUnit tests).
- The modules analysis is done using SourceGraph. Get it executing
cabal install SourceGraph. Note that you'll need to have dot installed for the graphs to be generated. You can download dot from http://graphviz.org/.
- EclipseFP includes support for Alex, Happy and UUAGC. To be able to build your files and get error and warnings shown, you need to install the corresponding packages doing
cabal install alex,
cabal install happy and
cabal install uuagc.
- Projects using Snap or Yesod web frameworks can be created automatically, but only if those packages are installed. To get them, follow the instructions in their official sites.
Extra Eclipse plug-ins
For some features, you need to install extra Eclipse plug-ins. EclipseFP can run without them, and will warn you if they are needed. Those plug-ins are:
- BIRT Charting Engine: needed to show profiling output. To install it, follow the same steps of the main installation, but use
http://download.eclipse.org/birt/update-site/3.7 as update site for Eclipse 3.x and
http://download.eclipse.org/birt/update-site/4.3 for Eclipse 4.3.
- Web Platform Tools: needed to highlight and provide autocompletion for web-related files. To install it, follow the same steps of the main installation, but use