简体   繁体   中英

cabal error: Could not find module `GHC.TypeLits'. How do I fix this?

I get the following when trying to install 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

I've tried installing the package using cabal (cabal install ghc-prim) but there's no such package. Also tried

$ 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.

Any suggestions?

The module GHC.TypeLits is only available from base-4.6 on, with ghc-7.6.1.

I don't see any guards around the import, so the stated constraints on base in the build-depends are wrong in the versions 0.1.0.0 and 0.1.0.1.

If you want to install that package, you have to upgrade to ghc-7.6 or install a version < 0.1,

$ cabal-install "HLearn-distributions < 0.1" 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM