illabout
illabout

Reputation: 3636

How to search for typeclass instances on Hoogle?

Is there a way to search for instances of a typeclass on Hoogle (or Stackage)?

For instance, I want to know which package defines an instance of Lift for Text.

I was able to find it in the package th-lift-instances, but it took about 10 minutes of manual searching. It seems like there should be some functionality of Hoogle that allows searching for instances.

Upvotes: 10

Views: 644

Answers (2)

Wizek
Wizek

Reputation: 4993

Expanding on Kolmar's comment, some Google techniques do go a long way towards finding instances.

Examples:

-inurl: is used to clean up superfluous results from where the typeclass was defined.

Upvotes: 2

Daniel Wagner
Daniel Wagner

Reputation: 153102

For now, no. However, a feature was recently added to haddock to allow instances to link to their source, and all new documentation built on Hackage has that turned on. So in the next release of the th-lift package, you should see a "Source" link next to the Lift Text instance that will tell you what you need to know.

Upvotes: 5

Related Questions