cabal错误:找不到模块`GHC.TypeLits'。我该如何解决?

时间:2013-01-05 22:40:30

标签: haskell cabal

尝试安装Hlearn时,我得到以下内容:

$ cabal install HLearn-distributions --ghc-options=-XConstraintKinds
Resolving dependencies...
Configuring HLearn-distributions-0.1.0.1...
Building HLearn-distributions-0.1.0.1...
Preprocessing library HLearn-distributions-0.1.0.1...

src\HLearn\Models\Distributions\Moments.hs:13:14:
    Warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.

src\HLearn\Models\Distributions\Moments.hs:24:8:
    Could not find module `GHC.TypeLits'
    Perhaps you meant GHC.Types (needs flag -package ghc-prim)
    Use -v to see a list of the files searched for.
cabal.exe: Error: some packages failed to install:
HLearn-distributions-0.1.0.1 failed during the building phase. The exception
was:
ExitFailure 1

我尝试使用cabal(cabal install ghc-prim)安装软件包,但是没有这样的软件包。也尝试了

$ cabal install HLearn-distributions --ghc-options=-XConstraintKinds -f-package ghc-prim
cabal.exe: There is no package named 'ghc-prim'.
You may need to run 'cabal update' to get the latest list of available
packages.

有什么建议吗?

1 个答案:

答案 0 :(得分:4)

模块GHC.TypeLits仅在base-4.6开启时使用ghc-7.6.1。

我没有看到导入的任何保护,因此在版本0.1.0.0和0.1.0.1中,构建依赖中base的所述约束是错误的。

如果要安装该软件包,则必须升级到ghc-7.6或安装版本< 0.1,

$ cabal-install "HLearn-distributions < 0.1"