即使安装了mtl,也找不到模块'Control.Monad.State'

时间:2016-01-07 11:32:23

标签: haskell ghc cabal

当我尝试加载包含import Control.Monad.State的模块时 我得到了

Could not find module ‘Control.Monad.State’
Perhaps you meant
  Control.Monad.ST (from base-4.8.2.0)
  Control.Monad.ST.Safe (from base-4.8.2.0)
  Control.Monad.Fix (from base-4.8.2.0)
Use -v to see a list of the files searched for.
Failed, modules loaded: none.

我安装了Haskell平台,它安装了cabal和mtl。

当我运行cabal update然后cabal install mtl时:

Resolving dependencies...
All the requested packages are already installed:
mtl-2.2.1
Use --reinstall if you want to reinstall anyway.

我尝试了重新安装标志,但它一直在给我警告,我会打破其他包裹,所以我没有继续。

我的ghc --versionversion 7.10.3cabal --version1.22.5.0

这是我跑ghc-pkg list mtl时所得到的:

WARNING: cache is out of date: Library/Frameworks/GHC.framework/Versions/7.10.3-x86_64/usr/lib/ghc-7.10.3/package.conf.d/package.cache
ghc will see an old view of this package db. Use 'ghc-pkg recache' to fix.
/Library/Frameworks/GHC.framework/Versions/7.10.3-x86_64/usr/lib/ghc-7.10.3/package.conf.d
   mtl-2.2.1

当我跑ghc-pkg check时:

WARNING: cache is out of date: /Library/Frameworks/GHC.framework/Versions/7.10.3-x86_64/usr/lib/ghc-7.10.3/package.conf.d/package.cache
ghc will see an old view of this package db. Use 'ghc-pkg recache' to fix.

当我跑ghc-pkg recache

ghc-pkg: /Library/Frameworks/GHC.framework/Versions/7.10.3-x86_64/usr/lib/ghc-7.10.3/package.conf.d/package.cache: you don't have permission to modify this file

0 个答案:

没有答案