为什么我无法导入此 Haskell module/package?
Why can't I import this Haskell module/package?
我使用 cabal 安装了 SourceGraph
包:
cabal install SourceGraph
完美安装,没有任何错误。
现在,我创建了一个名为 Test.hs
的文件来测试我是否能够导入并使用这个包。这些是 Test.hs
的内容:
module Test where
import SourceGraph
main = putStrLn "Hello World!"
当我执行 ghc Test
时,出现以下错误:
Could not find the module 'SourceGraph'
当我执行 ghc-pkg list
时,我在列表中找不到 SourceGraph
,尽管随它一起安装的所有依赖项都是可见的。
我签入了 C:\Users\MyName\AppData\Roaming\cabal\packages\hackage.haskell.org
,我可以在那里看到 SourceGraph
文件夹。
但是 C:\Users\MyName\AppData\Roaming\ghc\x86_64-mingw32-7.10.2\package.conf.d
.
中没有 SourceGraph
的 .conf
文件
此外,C:\Users\MyName\AppData\Roaming\cabal\logs
中的所有 .log
文件末尾都有一行 In-place registering packagename-version...
,但 SourceGraph-0.7.0.7,log
没有。
请帮忙?
[系统规格:GHCi 版本 7.10.2,Cabal 版本:1.22.4.0,OS:Windows 8 Pro,处理器:Intel Core i5(64 位)]
SourceGraph
不是一个库,它是一个在命令行上要 运行 的程序。
看到了 hackage page
上面写着(为 bash 提示添加了 $
s):
To use SourceGraph, call it as either:
$ SourceGraph path/to/Foo.cabal
Or, if your project doesn't use Cabal, then there is limited support for > using an overall module from your program/library:
$ SourceGraph path/to/Foo.hs
我使用 cabal 安装了 SourceGraph
包:
cabal install SourceGraph
完美安装,没有任何错误。
现在,我创建了一个名为 Test.hs
的文件来测试我是否能够导入并使用这个包。这些是 Test.hs
的内容:
module Test where
import SourceGraph
main = putStrLn "Hello World!"
当我执行 ghc Test
时,出现以下错误:
Could not find the module 'SourceGraph'
当我执行 ghc-pkg list
时,我在列表中找不到 SourceGraph
,尽管随它一起安装的所有依赖项都是可见的。
我签入了 C:\Users\MyName\AppData\Roaming\cabal\packages\hackage.haskell.org
,我可以在那里看到 SourceGraph
文件夹。
但是 C:\Users\MyName\AppData\Roaming\ghc\x86_64-mingw32-7.10.2\package.conf.d
.
中没有 SourceGraph
的 .conf
文件
此外,C:\Users\MyName\AppData\Roaming\cabal\logs
中的所有 .log
文件末尾都有一行 In-place registering packagename-version...
,但 SourceGraph-0.7.0.7,log
没有。
请帮忙?
[系统规格:GHCi 版本 7.10.2,Cabal 版本:1.22.4.0,OS:Windows 8 Pro,处理器:Intel Core i5(64 位)]
SourceGraph
不是一个库,它是一个在命令行上要 运行 的程序。
看到了 hackage page
上面写着(为 bash 提示添加了 $
s):
To use SourceGraph, call it as either:
$ SourceGraph path/to/Foo.cabal
Or, if your project doesn't use Cabal, then there is limited support for > using an overall module from your program/library:
$ SourceGraph path/to/Foo.hs