17

Maybe I am missing something, but is there a way to search inside some package on hackage?

Let's say I know that Snap framework has a function called render. How do I find it starting on it's hackage page: http://hackage.haskell.org/package/snap-0.9.0.1

Jonke
  • 6,525
  • 2
  • 25
  • 40
Andriy Drozdyuk
  • 58,435
  • 50
  • 171
  • 272

2 Answers2

22

You can use Hoogle for this (as for so many other things) by using the +package search operator.

By default, Hoogle will search inside a standard set of packages by name or by type:

Now, that's fine and dandy, but what about other packages? If you search for render, you find Render :: RenderMode from OpenGL, render :: Doc -> String from pretty, and some other things; the snap package isn't searched by default.

However, if you add +packagename or +Module.Name to your search, Hoogle will only search inside the specified packages (and -packagename and -Module.Name remove packages/modules from the search). Thus, searching for +snap render finds only the following three things:

For more information on using Hoogle, you can check its manual on the Haskell wiki.

Antal Spector-Zabusky
  • 36,191
  • 7
  • 77
  • 140
  • Wow, I've been using hoogle all the time, and never knew I could do this! – Andriy Drozdyuk Jun 26 '12 at 04:07
  • 5
    Nice! If you're looking for something, and you don't even know what package it is in, you can also use [hayoo](http://holumbus.fh-wedel.de/hayoo/hayoo.html). – Dan Burton Jun 26 '12 at 06:21
  • 1
    @DanBurton Thanks, but it didn't find the render function in Snap. – Andriy Drozdyuk Jun 26 '12 at 18:58
  • @drozzy does for me searching [render snap](http://holumbus.fh-wedel.de/hayoo/hayoo.html#0:render%20snap). If you just search for [render](http://holumbus.fh-wedel.de/hayoo/hayoo.html#0:render), there are 11 pages of results, and it's in there too, just not on the first page. – Dan Burton Jun 26 '12 at 22:31
  • @DanBurton Oh d'oh, I didn't see 11 pages of results. I thought there was just the one. Nevermind! – Andriy Drozdyuk Jun 27 '12 at 02:12
  • 1
    How come some packages return no results like `+megaparsec`? – CMCDragonkai May 07 '18 at 09:59
  • @CMCDragonkai: I think the Hackage hoogle hasn't updated recently/for a while, but I forget where I read that. The data does seem consistent with that, though… – Antal Spector-Zabusky May 14 '18 at 05:03
7

Click on the link to some module in the package. Then in the top right, there is an index link. Click on that, and then on the link to the letter with which the desired function begins.

Daniel Fischer
  • 181,706
  • 17
  • 308
  • 431