2008-09-26 76 views
11

我知道一个Haskell模块的名称,但我无法弄清楚它定义了哪个软件包。这很糟糕,因为如果没有暴露此模块的包,我无法编译。哪个Haskell软件包包含给定的模块

说明它是Text.Regex,我找不到,但我想知道如何解决一般问题。

回答

11

http://www.haskell.org/ghc/docs/latest/html/users_guide/packages.html

GHC-PKG查找模块Text.Regex

但是,这仅适用于(一)最近GHCs,和(b)您的系统上安装的软件包。

您也可以通过软件包文件(例如/usr/lib/ghc-6.8.2/package.conf)来查看安装的内容。

您也可以使用haskell API搜索引擎hooglehackage搜索引擎hayoo

Text.Regex位于软件包正则表达式基础中,还有一些其他软件基于它构建。

+0

我有ghc-pkg 6.8.2,它不接受查找模块:( – luntain 2008-09-26 20:45:55

1

最好的工具是:

两者都是Haskell模块和函数的搜索引擎。

2

如果您使用惊天动地,你已经安装的软件包,你可以尝试用cabal build编译它,而卡瓦尔会告诉你哪些包你忘记添加到您的依赖关系:

Main.hs:1:8: 
    Could not find module `Text.Regex': 
     It is a member of the hidden package `regex-compat-0.93.1'. 
     Perhaps you need to add `regex-compat' to the build-depends in your .cabal file. 
     Use -v to see a list of the files searched for. 
0

如果您使用的是Debian和Debian提供的软件包,则在/usr/share/doc/ghc-doc/html/libraries/index.html处有一个全局文档索引,其中列出了最后一列中的软件包。