Skip to content
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

Ask any questions you may have about Hoogle #2

Closed
ndmitchell opened this issue Mar 6, 2018 · 4 comments
Closed

Ask any questions you may have about Hoogle #2

ndmitchell opened this issue Mar 6, 2018 · 4 comments

Comments

@ndmitchell
Copy link

I see you are planning Hoogle integration. Please feel free to reach out with any questions about it.

Similarly, once it's done, let me know and I can put a link from the Hoogle repo.

@qwfy
Copy link
Owner

qwfy commented Mar 7, 2018

Wow, Thanks for the great Hoogle :)

I do have a few questions about hoogle.

A. The biggest question is that, is hoogle 5 suitable for daily use? I get mixed information about this:

I see this big warning on hoogle.haskell.org:

image

I presume that this warning is only for the web interface and not for the command line interface, since hoogle '[a] -> Int -> [a]' does work, am I correct?

Also there is a warning in the project's readme says something like "this is the development version of hoogle 5", and a few OSes ships hoogle 5 already.

B. If I download this archive, (found at https://www.stackage.org/lts-10.8), and unpack it to a directory, say /some-directory/lts-10.8, which will have a structure like this:

lts-10.8
├── abstract-deque-0.3
│   ├── abstract-deque.haddock
│   ├── abstract-deque.txt
│   ├── Data-Concurrent-Deque-Class.html
│   ├── Data-Concurrent-Deque-Debugger.html
│   ├── Data-Concurrent-Deque-Reference-DequeInstance.html
│   ├── Data-Concurrent-Deque-Reference.html
│   ├── doc-index.html
│   ├── haddock-util.js
│   ├── hslogo-16.png
│   ├── index.html
│   ├── LICENSE
│   ├── minus.gif
│   ├── ocean.css
│   ├── plus.gif
│   ├── src
│   │   ├── Data.Concurrent.Deque.Class.html
│   │   ├── Data.Concurrent.Deque.Debugger.html
│   │   ├── Data.Concurrent.Deque.Reference.DequeInstance.html
│   │   ├── Data.Concurrent.Deque.Reference.html
│   │   ├── highlight.js
│   │   └── style.css
│   └── synopsis.png
├── abstract-deque-tests-0.3
│   ├── abstract-deque-tests.haddock
│   ├── abstract-deque-tests.txt
│   ├── Data-Concurrent-Deque-Tests.html
│   ├── doc-index.html
│   ├── haddock-util.js
│   ├── hslogo-16.png
│   ├── index.html
│   ├── LICENSE
│   ├── minus.gif
│   ├── ocean.css
│   ├── plus.gif
│   ├── src
│   │   ├── Data.Concurrent.Deque.Tests.html
│   │   ├── highlight.js
│   │   └── style.css
...omitted

and generate a database with

hoogle generate --database lts-10.8.hoo --local=lts-10.8

and then query with Hoogle.searchDatabase, which will give results like this:

[ Target { targetURL = "file:///some-directory/lts-10.8/base-4.10.1.0/Prelude.html#v:id"
         , targetPackage = Just ("base","file:///some-directory/lts-10.8/base-4.10.1.0/")
         , targetModule = Just ("Prelude","file:///some-directory/lts-10.8/base-4.10.1.0/Prelude.html")
         , targetType = ""
         , targetItem = "<span class=name><0>id</0></span> :: a -&gt; a"
         , targetDocs = "Identity function.\n"
         }]

Should I consider this (the behaviour that prefixing url with file:///some-directory) a documented behaviour or an implementation detail?

Can I rely on the format of the targetItem? Ideally I want to parse it to an ADT, so I can display it differently (from the html format).

@ndmitchell
Copy link
Author

  • Hoogle 5 is the future and I'd recommend it. It has a few rough edges relative to Hoogle 4. I suggest you integrate with Hoogle 5.
  • Yes, prefixing the somedirectory is documented behaviour (it has to work that way so it can display documentation when run from toher directories).
  • For TargetItem, you can rely on the data type - it's public and intended for consumption. It may change in the future, but I have no plans to do so.

@qwfy
Copy link
Owner

qwfy commented Mar 14, 2018

The Hoogle has landed. A screenshot is available here

@ndmitchell
Copy link
Author

Awesome! I've added a link to the Hoogle README at https://github.com/ndmitchell/hoogle#others. The readme is a bit of a mess, so it is more making sure there is a placeholder so I don't forget about it when I give the manual a rewrite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants