Sunday, December 19, 2010

New Version of Hoogle (4.1)

I've just released a new version of Hoogle to both Hackage and to haskell.org/hoogle. Hoogle is a Haskell search engine that allows you to search for functions by either name or approximate type signature.

What's New


  • The first release in over a year, building with up to date packages and compilers.

  • Up to date library definitions for all of Hackage.

  • Searches the Haskell Platform by default.

  • Significant improvements when installing Hoogle locally.

  • Lots of additional small improvements.



Searching all of Hackage

Hoogle can now search all of Hackage. By default it will search the Haskell Platform, but you can search additional packages using +package-name, for example +tagsoup Tag a -> Bool. You can search both the platform and additional packages by including +default, for example ([a] -> (b, [a])) -> [a] -> [b] +split +default.

I'm still not sure what should be searched by default, and which collections of modules should be available, but I'm open to suggestions.

Installing Hoogle Locally

Many of the improvements to Hoogle are of specific benefit when installing Hoogle yourself, not using the web version. To install Hoogle:


cabal update
cabal install hoogle
hoogle data


The last step will download information and generate databases for the Haskell Platform. You can then run searches, such as hoogle filter -n10. Hoogle now uses cmdargs, so hoogle --help will detail some of the options available.

You can also run Hoogle as a web server by typing hoogle server. Now visit localhost in a web browser and you'll have the power of Hoogle on your computer. If you often work offline, you can run hoogle data --local and hoogle server --local to use documentation on your local machine where available.

What Now?

Hoogle is currently the spare time project I'm focusing on - there are lots of improvements I am intending to make. Hoogle 4.1 is about getting the code up to a standard that can be easily maintained, allowing future versions to deliver more features. Please try out Hoogle, report any bugs you find, and let me know your thoughts.

7 comments:

Anonymous said...

> I'm still not sure what should be searched by default, and which collections of modules should be available, but I'm open to suggestions.

everything.
let the users sort this out.

also, can you please add syntax to exclude some package from the search?

Neil Mitchell said...

Everything tends to mean massive frameworks (OpenGL for example) dominate the search results, where in practice people either know they want an OpenGL function, or know they don't.

There is already a syntax to exclude, -packagename - for example http://haskell.org/hoogle/?hoogle=read+-base

Paul Brauner said...

Hi, thanks for the great work!
I'm a happy user of hoogle locally and I am not sure what it means for hoogle to download the haskell platform data: what if I have installer more recent version of some package using cabal-install?
I guess this is has more to do with cabal than hoogle though.

Paul Brauner said...

In fact, I see this is issue 80 :)

Neil Mitchell said...

At the moment Hoogle is fairly lose when it comes to versions. It will document the latest versions of all packages it can find, regardless of what versions the platform specifies or that you have.

Hoogle also has no concept of what packages you have installed, so even in local mode it's just trying to find some extra docs that are available locally, it won't actually index what those docs contain. Bug 80 is meant to change this.

Anonymous said...

It would be more helpful to people not already familiar with Haskell's vocabulary if Hoogle supplied more concrete examples. I'm just starting out with Haskell and I find Hoogle to be far less useful than what is available at Zvon.org for example. Compare:
http://zvon.org/comp/r/ref-Haskell.html#Functions~Prelude.map

to http://hackage.haskell.org/packages/archive/base/latest/doc/html/Prelude.html#v:map

forget that you know Haskell and imagine how someone who doesn't quite get the basics might not be served well by the results returned by Hoogle as opposed to the results from Zvon.org.

Basically Hoogle needs to somehow be able to cross reference a set of data that explains how to read various things along with including concrete as opposed to abstract examples as this will help people better anchor concepts which may be foreign to them.

Neil Mitchell said...

Anon: Good point, I've raised a bug to track incorporating Zvon data: http://code.google.com/p/ndmitchell/issues/detail?id=405

Ideally the official Haskell documentation would improve to the stage where it was all that was needed, but lots of methods (i.e. max) are entirely undocumented.