Are there any special Haskell tools that can display source code from imported modules?

How can I better view Haskell source code without an internet connection? Now I am looking at the results of the search for hackers, I click on the link to the source and look at the source page. There are two problems:

  • I use the current version as a proxy server for what I have locally.
  • This does not work recursively (other clicks and searching for the next definition)

Typically, IDEs allow you to load sources for any library and open a new editor tab with a definition. I prefer to read the code than the documentation, fewer surprises along the way, and I can learn something from them.

So, how can I configure to recursively search for sources using Haskell tools or standard GNU tools, if necessary? All I know now is that I can generate ctags for vim, but where are the caching sources stored?

+6
source share
1 answer

This is a stubborn workflow that I am doing to provide documentation with the source link included.

$ cd <package-name> $ cabal sandbox init $ cabal install --only-dependencies --enable-documentation --haddock-hyperlink-source $ cabal configure --enable-documentation --haddock-hyperlink-source $ cabal haddock --hyperlink-source $ firefox dist/doc/html/<package-name>/index.html 

The Source link must be enabled for all packages, including dependencies, if installed in the sandbox.

In the specific case of Arch Linux that I use, I try to avoid installing Haskell system packages through pacman , because by default the documentation is not built with the source link turned on. On Arch Linux, you can use ABS and modify PKGBUILD with the options described above. I am pretty sure that something like this could be done on other distributions, but I have no idea about Windows or Mac OS X.

It is also worth noting that you do not need to enter these parameters every time cabal start cabal . You can enable them by default in .cabal/config

This should work without a sandbox, but if you are dealing with more than one Haskell project, I highly recommend using sandboxes.

+4
source

All Articles