-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add stack hoogle command (#55) #1939
Conversation
Oh, idea: we could have |
Awesome! Why make this part of the exec command? None of the exec options are relevant to hoogle. I can't think of any use for As for the hoogle version thing, how about when the hoogle invocation fails, run |
The fact that Hoogle 5 isn't released yet more than a year after I was aiming for does suck, and makes something like this harder, but I'm very grateful to @chrisdone for using the new version in preference (I owe 🍻). One way to sidestep version issues would have to have |
Yep, auto-installing hoogle 5 would be cool! |
I started a separate codepath but found myself repeating the code in that codepath, and saw that it uses
That's a nice idea. I'd considered auto-installing but thought that might be a bit invasive.
Re-considering it, perhaps it could use one of the .tar.gz from Github (avoiding the need for the Git dependency for users who don't have it) and yeah, just install it in Stack's own directory structure. That's consistent with the use of GHC. That gets around the problem of when Hoogle 5 is going to be released. We'd like for this to just work out of the box for newbies and experts alike. We can announce the feature in the next Stack release as simply One nice part of this feature is that you can hoogle your own codebase. A separate note: perhaps it should also run |
I think we're going to a do a release soon, should we add this? TODO as far as I'm concerned:
|
AFK till Monday but I'd like to contribute to getting this in before the |
Working on a new branch with the above things in mind. |
Pinging interested parties: @ndmitchell @borsboom @mgsloan @snoyberg
The feature
This is a regular
exec
interface to Hoogle, but it adds a--database
argument. This saves me from judging a new interface to Hoogle. The basic use-case is self-explanatory:To generate a database, one runs:
If you run
stack hoogle foo
without a database file present, it will automatically runstack hoogle --generate --local
:Details & issues
The database argument is set to
$PROJECT_ROOT/.stack-work/hoogle
as suggested by @ndmitchell in #55 (comment).The issue is that this support is available in Hoogle 5, which is not released yet. The workaround for users is to run:
With
hoogle
version 5 in the~/.local/bin
, the above feature works.