[英]GHCI - Failed to load interface for
要复制git clone https://github.com/ndmitchell/hoogle并在stack repl
:
λ > :l src/Hoogle.hs
[ 1 of 27] Compiling Input.Settings ( src/Input/Settings.hs, interpreted )
src/Input/Settings.hs:17:1: error:
Failed to load interface for ‘Paths_hoogle’
Use -v to see a list of the files searched for.
Failed, modules loaded: none.
这似乎是由于Paths_hoogle
被隐藏模块引起的,但是我不知道要加载src/Hoogle.hs
的解决方案是什么。
hoogle
项目没有stack.yaml
,因此stack
无法识别它在项目中。 stack repl
和stack ghci
将在隐式全局项目中打开GHCi环境。
对于stack
,检查当前目录中的.cabal
文件并警告它是否不在stack
项目中可能是明智的。
我能够通过执行stack init
生成初始的stack.yaml
文件来加载库。 然后stack repl
和stack ghci
都可以正常工作,加载暴露和隐藏的模块。
解决方案是使用以下命令运行GHCI repl:
cabal repl lib:hoogle
这会自动加载Hoogle模块:
Ok, modules loaded: Action.CmdLine, Action.Generate, Action.Search, Action.Server, Action.Test, General.Conduit, General.IString, General.Log, General.Store, General.Str, General.Template, General.Timing, General.Util, General.Web, Hoogle, Input.Cabal, Input.Download, Input.Haddock, Input.Item, Input.Reorder, Input.Set, Input.Settings, Output.Items, Output.Names, Output.Tags, Output.Types, Paths_hoogle, Query.
λ > defaultDatabaseLocation
"/home/neo/.hoogle/default-haskell-5.0.13.hoo"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.