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

Update (or remove) Hoogle plugin #167

Open
alanbriolat opened this issue Jul 7, 2019 · 0 comments
Open

Update (or remove) Hoogle plugin #167

alanbriolat opened this issue Jul 7, 2019 · 0 comments

Comments

@alanbriolat
Copy link
Member

We use(d) the JSON API of Hoogle version 4 at http://www.haskell.org/hoogle, but this is now a redirect to Hoogle version 5 at https://hoogle.haskell.org/.

Version 5 has changed the layout of the API responses, and also includes HTML markup. Example request/response from version 5:

$ curl -vL 'https://hoogle.haskell.org/?mode=json&hoogle=map&start=1&count=1' | jq 
[
  {
    "url": "https://hackage.haskell.org/package/base/docs/Prelude.html#v:map",
    "module": {
      "url": "https://hackage.haskell.org/package/base/docs/Prelude.html",
      "name": "Prelude"
    },
    "package": {
      "url": "https://hackage.haskell.org/package/base",
      "name": "base"
    },
    "item": "<span class=name><s0>map</s0></span> :: (a -&gt; b) -&gt; [a] -&gt; [b]",
    "type": "",
    "docs": "<a>map</a> <tt>f xs</tt> is the list obtained by applying <tt>f</tt>\nto each element of <tt>xs</tt>, i.e.,\n\n<pre>\nmap f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]\nmap f [x1, x2, ...] == [f x1, f x2, ...]\n</pre>\n"
  }
]

There are 2 options for resolving this issue:

  • Remove the plugin entirely: it's apparently taken months for us to notice this change, which says something about how often the plugin is used
  • Update the plugin for the new JSON format, stripping HTML tags and decoding HTML entities, with an appropriate test suite of example API responses and plugin output
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

1 participant