When I tried loading a module containing import Control.Monad.State
I got
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.
I installed the Haskell Platform, which has cabal and mtl installed.
When I run cabal update
and then cabal install mtl
:
Resolving dependencies...
All the requested packages are already installed:
mtl-2.2.1
Use --reinstall if you want to reinstall anyway.
I tried the reinstall flag but it just keeps giving me warnings that I will break other packages so I didn't continue.
My ghc --version
is version 7.10.3
. cabal --version
is 1.22.5.0
This is what I got when I ran 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
And when I ran 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.
And when I ran 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