Sunday, May 01, 2011

Searching GHC with Hoogle

Summary: Hoogle can now search the GHC source code. There are also lots of small improvements in the latest version.

A few weeks ago Ranjit Jhala asked me for help getting Hoogle working on the GHC documentation. As a result of this conversation, I've now released Hoogle 4.2.3, and upgraded the Hoogle web tool.

For GHC developers

You can search the GHC documentation using the standard Hoogle website, for example: llvm +ghc

To search within a package simply write +package in your search query. The ghc package on Hoogle includes all the internals for GHC.

If you want to search using the console, you can install Hoogle and generate the GHC package database with:

cabal update
cabal install hoogle
hoogle data default ghc

You can now perform searches with:

hoogle +ghc llvm

For all Hoogle users

The new release of Hoogle contains a number of small enhancements:

  • The web server has been upgraded to Warp. I'll write a blog post shortly on the move to Warp - but generally it's been a very positive step.

  • Some of the snippets of documentation have been fixed, where the markup was interpreted wrongly.

  • There is only an expand button next to the documentation if there is more information to expand.

  • Some iPad integration, so you can now add it to your home page with a nice icon.

  • Work on a deployment script to automate uploading a new version to the web server, which will allow for more frequent updates (until now it took over 2 hours to deploy a new version).

  • Updates as some web resources moved around, particularly the Haskell Platform cabal file.

The theory behind Hoogle

I'll be talking about the theory behind type searching in Hoogle at Trends in Functional Programming 2011 in Madrid in a few weeks time. It's not too late to register.


Anonymous said...

somehow i can not generate the database:

hoogle data default ghc

--2011-05-01 22:54:16--
Auflösen des Hostnamen »«...., 2a01:4f8:121:6::1:10
Verbindungsaufbau zu||:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort... 404 Not Found
2011-05-01 22:54:17 FEHLER 404: Not Found.

Am i doing something wrong ?

Neil Mitchell said...

Anon: Looks like you are using hoogle-4.2.1 or earlier. The web resource it is trying to find got moved, but newer versions know the new URL. A "cabal update && cabal install hoogle" should fix it.