ndmitchell / hoogle

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

Don't output results when specified module/package/category not found in db. #216

Closed wz1000 closed 7 years ago

wz1000 commented 7 years ago

Issue described in #215

Also fixes a bug where package names with upper case letters(QuickCheck, HaRe etc.) wouldn't be found in the db.

ndmitchell commented 7 years ago

Thanks for the patch. Could you please craft a few examples to add to the test suite - I imagine you could tack several examples at the end of https://github.com/ndmitchell/hoogle/blob/master/src/Action/Search.hs#L146. That way I won't regress the behaviour anytime in the future.

wz1000 commented 7 years ago

@ndmitchell OK, I'll do that in bit. There is some fiddly stuff going on though, so I would appreciate if you would take a look at the code.

ndmitchell commented 7 years ago

@wz1000 to be honest, the devil is in the details, and my head isn't familiar with this code to be sure either way - it certainly looks plausible. The tests are my measure of sanity - if you think the behaviour should change, and include the test suite changes, then it's easy to confirm what you are thinking makes sense.

wz1000 commented 7 years ago

@ndmitchell I added a couple of tests, but there is a deeper question about the behaviour of filters(especially in combination). Do you want them to behave like a logical 'and' or a logical 'or'? Currently they behave like an 'or'. This is slightly unintuitive.

I would personally expect

hoogle map package:vector module:Data.Vector

to behave like a logical "and", and

hoogle map module:Data.List module:Data.Vector

to behave like a logical 'or'.

or should the choice of behaviour somehow be exposed to the user, so they can choose themselves?

wz1000 commented 7 years ago

btw, the AppVeyor build failure doesn't seem to be my fault.

ndmitchell commented 7 years ago

Thanks! All merged, and I fixed up the appveyor failures that were happening before you committed.

Sorry for the delay in merging - holidays, illness, more illness - but now done! I'll make a release once the Travis/Appveyor all come back green.

ndmitchell commented 7 years ago

Released as hoogle-5.0.13.