ndmitchell / hoogle

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

--hackage flag to attach to a specific hackage server #52

Closed adinapoli closed 10 years ago

adinapoli commented 10 years ago

Hi Neil, as promised, here's the first tentative patch. The fix for CmdLine was trivial, so was the one for the action, because we had the CmdLine obj in scope. A bit more problematic and unfortunate was to push to the bottom of the stack the HackageURL (type synonym created just to aid readability) when we need to create databases and thus items for them. Last but not least, I was forced to expand "Convert" as well, because now the command makes sense only once we specify from which hackage we want to convert. Thoughts? I wasn't sure of the code style either. Generally, whatever I've modified for the patch I've also tried to push it to <= 80 columns, please shout if it's not ok! :)

I haven't run the tests, but I did run "hoogle data" with and without the "-h" flag, observing that hoogle is now trying to fetch data according to the URL specified in the flag.

Thanks! Alfredo

adinapoli commented 10 years ago

Wow, glad you decided to merge it at the fist pass :) It would be an honour to be listed as contributor, but if it's a problem nevermind!

Bye, Alfredo

ndmitchell commented 10 years ago

The patches actually broke the tests as per Travis (see https://travis-ci.org/ndmitchell/hoogle/builds/17489962) - d091fd2 fixes that, it was an accidentally captured variable. I also changed the semantics so you have to pass the trailing / on hackage, e.g. --hackage=http://hackage.haskell.org/ - that seems more correct, since it's now a full URL.

Feel free to send a pull request with the addition of yourself to the list of authors in the README.md, including a link to your website, if you wish.

adinapoli commented 10 years ago

Ouch, well spotted, and sorry for the disruption! I'll send the PR later in the weekend, thanks again!

Alfredo