Skip to content

Update (or remove) Hoogle plugin #167

@alanbriolat

Description

@alanbriolat

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions