[英]ghc-mod can't find a user installed module
我遇到ghc-mod
找不到〜/ .ghc /目录中安装的模块的情况。
该程序(foo.hs)只是:
import Control.Monad.Loops
main = undefined
ghci
加载foo.hs
没有任何错误。
ghc-pkg list
产生输出:
/Library/Frameworks/GHC.framework/Versions/7.8.3-x86_64/usr/lib/ghc-7.8.3/package.conf.d
Cabal-1.18.1.4
GLURaw-1.4.0.1
...
~/.ghc/x86_64-darwin-7.8.3/package.conf.d:
...
monad-loops-0.4.2.1
但是ghc-mod check foo.hs
错误:
x.hs:4:8:Could not find module ‘Control.Monad.Loops’Perhaps you meant Control.Monad.Cont (from mtl-2.1.3.1) Control.Monad.List (from mtl-2.1.3.1) Control.Monad.Trans (from mtl-2.1.3.1)Use -v to see a list of the files searched for.
ghc-mod
位于〜/ Library / Haskell / bin中, ghc-mod -v
发出:
ghc-mod version 5.0.1.2 compiled by GHC 7.8.3
...
有点奇怪的是,在foo.hs
模式下在Emacs中加载foo.hs
时我没有收到错误,并且推测它也使用ghc-mod
。
有没有办法进一步调试和/或配置ghc-mod以查看我的〜/ .ghc目录?
答案是ghc-mod
将在当前工作目录的所有父目录中查找cabal.sandbox.config
文件,并在找到该文件时使用该文件,这将隐藏我的~/.ghc
软件包目录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.