How to find the source code (implementation) of a class in Haskell

I read the IxSet documentation http://happstack.com/docs/crashcourse/AcidState.html#ixset , and I was interested in looking at the source of the indexed type that is imported from Data.IxSet.

So, I took the Happstack repository and looked there (darcs get http://patch-tag.com/r/mae/happstack ), but that led me to even more disappointment.

I see the happstack / happstack-ixset / src / Happstack / Data / IxSet.hs file that the Happstack.Data.IxSet module creates, but I don’t see which file the Data.IxSet module creates (and implements the Indexable class).

+4
source share
2 answers

Incoming address for Haskell hackage code. There is a handy link to Hayoo on the front page, another major Haskell search engine besides Hoogle . Both have advantages above the others.

Hayoo indexes all packages in the hack, and the default search queries include all packages in the hack. If you want to find a famous name, for example. Indexable , that is, a more convenient engine, especially if you don’t know which package the name comes from. Data.IxSet.Indexable now, the fifth hit will lead you to Data.IxSet.Indexable . To the right of the Haddock documents you will find the Source link, which will lead you to hscoloured sources (in this case, it is not very informative, although there is only one member of the class, without a default implementation, it does not tell you anything about the documents).

Hoogle only searches for a small number of packages by default, if you want to include other packages in the search, you must specify this by adding +packagename to the search, but this limits the search to the specified package. Learn more about Google search in the manual . The power of Google is search by type. A Google search by type applies more conversions to the type you are looking for and thus finds more matches than Hayoo if you don't know the exact type (that is, not without flaws, but sometimes you get a lot of irrelevant hits). If you are looking for an example Map ka -> k -> Maybe a , the first Google result is the most likely candidate Data.Map.lookup :: Ord k => k -> Map ka -> Maybe a , whereas Hayoo does not find this, because that he doesn't make permutation arguments.

In any case, both search engines lead you to hack Haddock documents for the requested object (if the search was successful), from where the Source links will take you to the code if you want.

+5
source

Use the Haddock documentation locally generated or online. Typically, a Google search returns relevant documents at the top. The documentation is stitched, so you can view surfing in the module you need. There is a link to the source next to each definition, for example .

This particular module belongs to a set of core libraries.

+1
source

All Articles