[英]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.