Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell Cabal+Nix: Generate local documentation for all dependencies in a project

Tags:

haskell

cabal

nix

How can I generate documentation, possibly with a local hoogle server, with cabal and nix?

I know there is a cabal new-haddock command, but it throws an error:

cabal: renderBuildTargetProblem: unexpected status (TargetDisabledByUser,Nothing)
CallStack (from HasCallStack):
  error, called at ./Distribution/Client/CmdErrorMessages.hs:329:14 in main:Distribution.Client.CmdErrorMessages

And it seems like it is used to build documentation of my project, not of my dependencies anyway.

like image 367
RowanStone Avatar asked May 12 '20 09:05

RowanStone


1 Answers

It turns out all documentation is already there in the /nix/store/. All I needed to do was to generate local documentation with hoogle like so:

hoogle generate --local --database project.hoo

Then start a server with:

hoogle server --local -p 8080

And now everything is statically linked. Done!

like image 177
RowanStone Avatar answered Nov 10 '22 07:11

RowanStone