我知道一个Haskell模块名称,但我无法弄清楚它是在什么包中定义的。这很糟糕,因为如果没有暴露这个模块的包,我就无法编译。
具体来说,我无法找到Text.Regex,但我想知道如何解决这个问题。
我知道一个Haskell模块名称,但我无法弄清楚它是在什么包中定义的。这很糟糕,因为如果没有暴露这个模块的包,我就无法编译。
具体来说,我无法找到Text.Regex,但我想知道如何解决这个问题。
http://www.haskell.org/ghc/docs/latest/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中,还有一些基于它构建。
http://www.haskell.org/ghc/docs/latest/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.
如果您使用的是Debian和Debian提供的软件包,那么有一个全局文档索引 /usr/share/doc/ghc-doc/html/libraries/index.html
其中列出了最后一列中的包。