如何使用cabal安装安装haddock

时间:2012-10-24 19:32:56

标签: haskell documentation cabal haddock

我尝试通过运行以下命令haddock来安装cabal install haddock,但我遇到了以下问题。

leonzo@lion:~/opt$ cabal install haddock
Resolving dependencies...
Configuring haddock-2.11.0...
Building haddock-2.11.0...
Preprocessing library haddock-2.11.0...
unused terminals: 1
[ 1 of 31] Compiling Haddock.Backends.HaddockDB ( src/Haddock/Backends/HaddockDB.hs, dist/build/Haddock/Backends/HaddockDB.o )
[ 2 of 31] Compiling Haddock.Backends.Xhtml.Types ( src/Haddock/Backends/Xhtml/Types.hs, dist/build/Haddock/Backends/Xhtml/Types.o )
[ 3 of 31] Compiling Haddock.Convert  ( src/Haddock/Convert.hs, dist/build/Haddock/Convert.o )
[ 4 of 31] Compiling Paths_haddock    ( dist/build/autogen/Paths_haddock.hs,     dist/build/Paths_haddock.o )
[ 5 of 31] Compiling Haddock.GhcUtils ( src/Haddock/GhcUtils.hs, dist/build/Haddock/GhcUtils.o )
[ 6 of 31] Compiling Haddock.Version  ( src/Haddock/Version.hs, dist/build/Haddock/Version.o )
[ 7 of 31] Compiling Haddock.Lex      ( dist/build/Haddock/Lex.hs, dist/build/Haddock/Lex.o )
[ 8 of 31] Compiling Haddock.Types    ( src/Haddock/Types.hs, dist/build/Haddock/Types.o )
[ 9 of 31] Compiling Haddock.Utils    ( src/Haddock/Utils.hs, dist/build/Haddock/Utils.o )
[10 of 31] Compiling Haddock.Options  ( src/Haddock/Options.hs, dist/build/Haddock/Options.o )
[11 of 31] Compiling Haddock.Backends.Xhtml.Themes ( src/Haddock/Backends/Xhtml/Themes.hs, dist/build/Haddock/Backends/Xhtml/Themes.o )
[12 of 31] Compiling Haddock.Backends.Xhtml.Utils ( src/Haddock/Backends/Xhtml/Utils.hs, dist/build/Haddock/Backends/Xhtml/Utils.o )
[13 of 31] Compiling Haddock.Backends.LaTeX ( src/Haddock/Backends/LaTeX.hs, dist/build/Haddock/Backends/LaTeX.o )
[14 of 31] Compiling Haddock.Backends.Hoogle ( src/Haddock/Backends/Hoogle.hs, dist/build/Haddock/Backends/Hoogle.o )
[15 of 31] Compiling Haddock.Interface.AttachInstances ( src/Haddock/Interface/AttachInstances.hs, dist/build/Haddock/Interface/AttachInstances.o )
[16 of 31] Compiling Haddock.Interface.Rename ( src/Haddock/Interface/Rename.hs, dist/build/Haddock/Interface/Rename.o )
[17 of 31] Compiling Haddock.Doc      ( src/Haddock/Doc.hs, dist/build/Haddock/Doc.o )
[18 of 31] Compiling Haddock.Parse    ( dist/build/Haddock/Parse.hs, dist/build/Haddock/Parse.o )
[19 of 31] Compiling Haddock.Interface.ParseModuleHeader ( src/Haddock/Interface/ParseModuleHeader.hs, dist/build/Haddock/Interface/ParseModuleHeader.o )
[20 of 31] Compiling Haddock.Interface.LexParseRn ( src/Haddock/Interface/LexParseRn.hs, dist/build/Haddock/Interface/LexParseRn.o )

src/Haddock/Interface/LexParseRn.hs:67:52:
Not in scope: type constructor or class `SafeHaskellMode'
cabal: Error: some packages failed to install:
haddock-2.11.0 failed during the building phase. The exception was:
ExitFailure 1
leonzo@lion:~/opt$

有人知道如何处理这个烂摊子吗?

修改 我的ghc版本是7.4.1

1 个答案:

答案 0 :(得分:10)

如今,黑线鳕版本与GHC版本紧密相关。对于ghc-7.4.1,相应的haddock版本为2.10.0。

错误消息中引用的SafeHaskellMode类型已添加到ghc-7.4.2中,因此您无法使用ghc-7.4.1编译haddock-2.11。

你的GHC应该有一个工作的haddock-2.10。如果没有,你可以安装haddock-2.10.0,或者你可以升级你的GHC(推荐,自7.4.1以来已经修复了几个错误)。