Before getting to the meat of the tutorial, I thought it would be good to provide some setup
information in a distinct, easy to find place. This short post will tell you where to find
a Haskell implementation and related tools.
I’m testing my examples for these articles using two different Haskell implementations:
- A very nice interactive Haskell interpreter. Hugs doesn’t quite implement
everything in the current Haskell specification, but it’s limits shouldn’t affect
anything I’ll cover in this tutorial, and probably won’t affect any moderate-to-large
size programs you want to write.
- The Glasgow Haskell Compiler, a high performance optimizing Haskell compiler. GHC implements
every last bit of the Haskell spec, as well as a bunch of nifty extensions. It’s also
got an interactive mode, called
ghciwhich is included in its distribution.
GHC is pretty much the gold standard in Haskell implementations.
Editors and Development Environments
It’s also good to have some extra tool support for Haskell programming. A lot of editors, such as
emacs, vim, and textmate provide Haskell tooling. The best tooling that I’ve seen is the EclipseFP feature for the Eclipse programming environment. Admittedly, I’m a bit biased here;
I’ve used to lead an Eclipse-based research project, so I’m a huge Eclipse fan. But the Eclipse
Haskell support really is very nice, and it’s very easy to set up. Installing Eclipse involves
nothing more than downloading it – it runs very smoothly in-place with no setup; and installing
EclipseFP can be done inside of Eclipse using the update manager – there’s a complete step by step
explanation at the EclipseFP homepage linked above.
If you’re a visual studio user, there’s a Haskell package called Visual Haskell. I’ve never used it (I’m not
a windows guy; I use MacOS and Linux.), but I’ve heard quite good things about it.
If you prefer just using a simple text editor, vim includes the Haskell package; for emacs, you
can get a Haskell mode here. For TextMate, you can get
the Haskell bundle via the normal bundle installation route.
For understanding the execution of Haskell programs, particularly when the laziness gets a bit
confusing, being able to generate an execution trace can be a huge help. There’s a tool called Hat which can generate very nice, easy to follow traces for
You can write fancy documentation for Haskell programs using a tool called Haddock. Haddock is something like Javadoc for
Haskell. It piggybacks on a “literate” syntax mode built-in to both GHC and Hugs, so
at least primitive support for Haddock is included in all of the Haskell tools; many also
provide additional Haddock support.
The capital of the online Haskell world is the Haskell.org site. It has links to numerous other tutorials, the language spec, implementations, events, etc.
There’s a Haskell blog called The Complete Sequence, which includes a weekly Haskell news update, as well as other interesting articles and links. There’s another Haskell blog called Planet Haskell which also has some good material.