我尝试使用haddock为库生成文档,虽然它有效但它不会链接任何属于GHC /标准库的类型并发出此错误:
Warning: The documentation for the following packages are not installed. No
links will be generated to these packages: array-0.4.0.1, base-4.6.0.1,
binary-0.5.1.1, rts-1.0, bytestring-0.10.0.2, containers-0.5.0.0,
deepseq-1.3.0.1, ghc-prim-0.3.0.0, integer-gmp-0.5.0.0, utf8-string-1
Haddock coverage:
93% ( 14 / 15) in 'projectname'
Warning: SHA1: could not find link destinations for:
GHC.Base.String Data.ByteString.Lazy.Internal.ByteString GHC.Word.Word32 GHC.Integer.Type.Integer GHC.Types.Int Data.Sequence.Seq
现在我用Google搜索并发现该解决方案会尝试使用haddock install array-0.4.0.1 base-4.6.0.1 binary-0.5.1.1 rts-1.0 bytestring-0.10.0.2 containers-0.5.0.0 deepseq-1.3.0.1 ghc-prim-0.3.0.0 integer-gmp-0.5.0.0 utf8-string-1 --enable-documentation
重新安装这些软件包,但它会失败
cabal: Could not resolve dependencies:
rejecting: base-4.8.0.0, 4.7.0.2, 4.7.0.1, 4.7.0.0 (global constraint requires
==4.6.0.1)
rejecting: base-4.6.0.1 (only already installed instances can be used)
rejecting: base-4.6.0.0, 4.5.1.0, 4.5.0.0, 4.4.1.0, 4.4.0.0, 4.3.1.0, 4.3.0.0,
4.2.0.2, 4.2.0.1, 4.2.0.0, 4.1.0.0, 4.0.0.0, 3.0.3.2, 3.0.3.1 (global
constraint requires ==4.6.0.1)
并且甚至找不到名为rts的包。发生了什么事?
答案 0 :(得分:3)
在Debian和Ubuntu上,Haskell平台文档在单独的包(haskell-platform-doc
)中提供。您可以使用apt-get
安装它:
sudo apt-get install haskell-platform-doc
我建议同时安装分析库(haskell-platform-prof
)。