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
You can use Hoogle for this (as for so many other things) by using the
+packagesearch operator.By default, Hoogle will search inside a standard set of packages by name or by type:
traversewill find:traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)base Data.Traversable
traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()base Data.Foldable
Map each element of a structure to an action, evaluate these actions from left to right, and ignore the results.
(a -> b -> c) -> f a -> f b -> f cwill find:liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m rbase Control.Monad
Promote a function to a monad, scanning the monadic arguments from left to right.
liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f cbase Control.Applicative
Lift a binary function to actions.
Now, that’s fine and dandy, but what about other packages? If you search for
render, you findRender :: RenderModefrom OpenGL,render :: Doc -> Stringfrom pretty, and some other things; the snap package isn’t searched by default.However, if you add
+packagenameor+Module.Nameto your search, Hoogle will only search inside the specified packages (and-packagenameand-Module.Nameremove packages/modules from the search). Thus, searching for+snap renderfinds only the following three things:render :: HasHeist b => ByteString -> Handler b v ()snap Snap.Snaplet.Heist
Renders a template as text/html. If the given template is not found, this returns empty.
renderAs :: HasHeist b => ByteString -> ByteString -> Handler b v ()snap Snap.Snaplet.Heist
Renders a template as the given content type. If the given template is not found, this returns empty.
renderWithSplices :: HasHeist b => ByteString -> [(Text, SnapletSplice b v)] -> Handler b v ()snap Snap.Snaplet.Heist
Renders a template with a given set of splices. This is syntax sugar for a common combination of heistLocal, bindSplices, and render.
For more information on using Hoogle, you can check its manual on the Haskell wiki.