簡體   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