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.
source share