ndmitchell / hoogle

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

Perhaps `generate --local=dir` could be recursive? #182

Closed mdorman closed 8 years ago

mdorman commented 8 years ago

Nix has, for a while, had an expression, 'ghcWithHoogle', that can take a list of packages, and will produce a ghc install with the listed packages installed, and the documentation indexed with an appropriately configured hoogle.

It previously used rehoo and some shell scripts to assemble this database, but that broke with hoogle 5 showed up.

I had some hope that hoogle's ability to drive itself from the output of ghc-pkg list, but the way things are built is such that that list isn't complete at the time that we're wanting to call hoogle.

As a result, I've come to the conclusion that the easiest option (for us, at least) would be if the generate --local=dir invocation did a recursive crawl of the directory. Is that something you would be amenable to if I produced a patch?

ndmitchell commented 8 years ago

That sounds entirely reasonable. I think it should be as simple as flipping https://github.com/ndmitchell/hoogle/blob/master/src/Action/Generate.hs#L131 from listFiles to listFilesRecursive - if that works for you, I'd happily accept a patch.

mdorman commented 8 years ago

Ha, I had expected to have to hand-roll that. Even better. It might take me until the weekend before I can really get everything set up to test and verify, but the change certainly seems simple enough.

ndmitchell commented 8 years ago

Fixed by #183.