Brandon Werner

How To Install Haskell Haddock on Mac OS X

If you’re scratching around trying to find out how to compile Haddock after getting the source, especially if you are using the awesome EclipseFP plug-in for Eclipse which has it’s use integrated inside the IDE, here are the steps:

First, ensure you have Glasgow Haskell Compiler installed, obviously. It has a OS X binary port and I like it over HUGS.

Second, you should really have Happy and Alex installed as well, as the build will look for it, and they are good to have, but will work fine without it.

from your unzipped directory:

$ ghc -o Setup Setup.lhs -package Cabal
$ ./Setup configure --ghc --prefix=${prefix} --enable-library-profiling
$ ./Setup build -v
$ ./Setup copy --copy-prefix=/usr/local/

Of course, /usr/local could be wherever you want the executable and libs to be installed. It has a /bin and /share.

After this step, you should be able to run Haddock documentation extraction from the Eclipse IDE. If you’re curious how Haskell looks in Eclipse with the EclipseFP plug-in, here it is:

Haskell Eclipse Thumbnail

With module support and outline expansion, it still takes heavily from the OO world (it doesn’t keep this updated if playing with the shell, for instance) it’s still somewhat nice to keep things organized. Of course, the IDE paradigm changes substantially when you are talking about lazy dynamically typed call-by-value languages. Still, for a round peg trying to fit in a square hole, it’s ok.

I still perfer the Haskell editor in the incredible TextMate, however.

One Response to “How To Install Haskell Haddock on Mac OS X”

  1. David Matuszek Says:

    You say “from your unzipped directory….”

    I used Eclipse Help > Software updates > Find and install… to install the Haskell plugin.
    I can’t find a directory from which the above commands work. I can find the (nonexecutable)
    haddock.jar, and I can find two Cabal folders and a Cabal-1.2.3.0 folder. The latter has
    Setup.hi and Setup.p_hi in it (what are those extensions?), but there is no Setup.lhs that
    I can find. There’s also a cabalcore.jar and a caballui.jar, neither of which can be launched.

    I’m running Mac OSX 10.5 Leopard, which _IS_ Unix.

    Can you clarify how I can install Haddock?

    Thanks,
    Dave

Leave a Reply