ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
738 stars 134 forks source link

Add support for doing exact searches (search --exact) #8

Closed jwiegley closed 11 years ago

jwiegley commented 11 years ago

I added this support because we need exact searching (package + module + identifier) for looking up documentation within our environment. The command-line variant just fell out as a bonus.

ndmitchell commented 11 years ago

The layering intention is that Hoogle is the module exposing all Hoogle related functionality, and things like Hoogle.Query.All are hidden inside. They shouldn't be exposed in the .cabal file, or used in places like CmdLine.All.

I think you can easily resolve the current layering issues by adding queryExact :: Query -> Query or similar to set the exact flag on a query, exposing that from the Hoogle module, and then importing that from the CmdLine.All module. With that tweak, it looks good.

jwiegley commented 11 years ago

All changes for this branch made. If you have any other requests, let me know!

jwiegley commented 11 years ago

Did a rebase, to make sure this request contains only the commits I intended.

jwiegley commented 11 years ago

Neil, after you accept this patch (that is, if you do), I have another one waiting in the wings for you: qualified exact lookups. It lets you not only ask for "Foo" specifically, but you can further qualify on the type, data constructor or type class definitions.