我尝试通过运行以下命令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

最佳答案

如今,黑线鳕版本已与GHC版本紧密绑定(bind)。对于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起已修复了两个错误)。

10-06 02:45