繁体   English   中英

GHCI-无法加载以下接口

[英]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 replstack ghci将在隐式全局项目中打开GHCi环境。

对于stack ,检查当前目录中的.cabal文件并警告它是否不在stack项目中可能是明智的。

我能够通过执行stack init生成初始的stack.yaml文件来加载库。 然后stack replstack 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.

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