hoogle
hoogle copied to clipboard
Missing extensibility features
There are few features in Hoogle that previously existed, that aren't available anymore:
- Specifying an output directory for database generation
- Generation of databases from text files
- Combining databases
- Specifying an input database for the server
Was there a reason these features were removed? Were they moved into another tool?
These features look very essential for any kind of extensibility.
Reference: https://wiki.haskell.org/Hoogle PS: The amount of time and effort put into Hoogle is highly admired and appreciated :)
I just went through https://github.com/ndmitchell/hoogle/issues/288
The reason for not having database combination is that they throw away lots of the essential information during construction. I'm not sure I understand why. In my view, Hoogle essentially a sophisticated text search. Need to really dig in to understand which information is lost and see if there's a way to retain it.
I will go through the code but a small overview on database generating is highly appreciated.
There was a lot of rewriting for Hoogle 5, so feature that were in Hoogle 4 and didn't carry over aren't necessary intentional.
Going through the features:
- Specifying an output directory is just
hoogle generate --database=whatever
so you can specify an output. - Generation of databases from text files can be done by passing them on the command line. I don't honestly remember the exact details though.
- Combining databases has gone away and isn't coming back.
- You can specify the input database with
hoogle server --database=whatever
Rather than create two databases and combine them, why not just create one database from the inputs of the two straight off? Given that route is available, adding anything additional to the database to preserve full fidelity doesn't seem that useful. As it happens, the database mostly does have all the inputs in it, some in the doc fields. I'm sure you could improve that to make sure it was literally everything. I'm just not sure what use case that unlocks.
For point 2 about generating from a text file, you don't specify the file itself, but rather the containing directory.
For example, if my text database is in docs/MyProject.txt
, then I need to invoke hoogle generate --local=docs
. Keep in mind, this will slurp up any other .txt
files as well!
I have a branch which adds the --source
flag back, which lets you directly point to the file. I can make a PR with it if that would be helpful. Otherwise, it might be useful to add more documentation around the --local
flag and its possible variants (I can make that PR, too)
@ndmitchell Thank you for your response. I'll get back to you with a more detailed answer why certain features are required. As I keep working, I will eventually hit a wall and thereby come up with better and more detailed reasons.
@michaelbjames Thank you for the response!
I have a branch which adds the --source flag back, which lets you directly point to the file. I can make a PR with it if that would be helpful. Otherwise, it might be useful to add more documentation around the --local flag and its possible variants (I can make that PR, too)
That would be awesome. The documentation can always be improved. Please point me to the repo/branch.
I came here wondering why I can’t hoogle dump
and other commands that are documented in https://wiki.haskell.org/Hoogle. That's not official documentation, but maybe someone finds the time to update that page.
Ah, I didn’t see the “Below is the old manual, which is gradually being phased out.”, sorry for the noise. It’s still linked from https://hoogle.haskell.org/, though.