Haskell Cabal+Nix:为项目中的所有依赖项生成本地文档

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

如何使用本地 hoogle 服务器、cabal 和 nix 生成文档?

我知道有一个 cabal new-haddock 命令,但它会抛出一个错误:

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

它似乎用于构建我的项目的文档,而不是我的依赖项。

事实证明,所有文档都已存在于 /nix/store/ 中。 我需要做的就是使用 hoogle 生成本地文档,如下所示:

hoogle generate --local --database project.hoo

然后启动服务器:

hoogle server --local -p 8080

现在一切都是静态链接的。完成!