我知道Haskell模块的名字,但我不能找出在什么样的包裹它的定义。这是不好的因为我不能编制没有包揭露这一模块。

Specificaly它文本。Regex,我不能找到,但我想知道如何解决这一问题的一般。

有帮助吗?

解决方案

http://www.haskell.org/ghc/文档/最新/ HTML / users_guide / packages.html中

ghc-pkg find-module Text.Regex

但这仅适用于(a)最近的GHC,以及(b)系统上安装的软件包。

您还可以浏览包文件(例如/usr/lib/ghc-6.8.2/package.conf)以查看已安装的内容。

您还可以使用haskell API搜索引擎 hoogle hackage 搜索引擎 hayoo

Text.Regex位于regex-base包中,还有一些基于它构建。

其他提示

如果您正在使用Cabal并且安装了软件包,则可以尝试使用 cabal build 进行编译,然后Cabal将通知您忘记添加到依赖项中的软件包:

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.

最好的工具是:

两者都是搜索引擎Haskell模块的功能。

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top