我已经使用Cabal安装网络,HTTP,http-conduit和http-client进行了安装。当我运行ghc时,它仍然会引发此错误:
testRun.hs:1:1: error:
Could not find module `Network.HTTP.Simple'
Perhaps you meant
Network.HTTP.Base (from HTTP-4000.3.12)
Network.HTTP.Cookie (from HTTP-4000.3.12)
Network.HTTP.Stream (from HTTP-4000.3.12)
Use -v to see a list of the files searched for.
|
1 | import Network.HTTP.Simple
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
或如果使用导管则出现此错误:
testRun.hs:1:1: error:
Could not find module `Network.HTTP.Conduit'
Perhaps you meant Network.HTTP.Cookie (from HTTP-4000.3.12)
Use -v to see a list of the files searched for.
|
1 | import Network.HTTP.Conduit (simpleHttp)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
需要安装什么?
答案 0 :(得分:0)
它使用了不同的方法(使用堆栈作为脚本解释器),但是很可能以下命令将使用可用的必要库来运行脚本:
stack --resolver lts-12.9 script testRun.hs