I know a Haskell module name, but I can't figure out in what package it is defined. This is bad because I can't compile without a package exposing this module.
我知道一个Haskell模块名称,但我无法弄清楚它是在什么包中定义的。这很糟糕,因为如果没有暴露这个模块的包,我就无法编译。
Specificaly it is Text.Regex that I can't locate, but I would like to know how to solve that problem in general.
具体来说,我无法找到Text.Regex,但我想知道如何解决这个问题。
4 个解决方案
#1
13
http://www.haskell.org/ghc/docs/latest/html/users_guide/packages.html
ghc-pkg find-module Text.Regex
ghc-pkg find-module Text.Regex
But that only works for (a) recent GHCs, and (b) packages installed on your system.
但这仅适用于(a)最近的GHC,以及(b)系统上安装的软件包。
You can also grep through the package file (e.g. /usr/lib/ghc-6.8.2/package.conf) to see what's installed.
您还可以浏览包文件(例如/usr/lib/ghc-6.8.2/package.conf)以查看已安装的内容。
You can also use either the haskell API search engines hoogle or the hackage search engine hayoo.
您还可以使用haskell API搜索引擎hoogle或hackage搜索引擎hayoo。
Text.Regex is in the package regex-base, and a few others built on top of it.
Text.Regex在包regex-base中,还有一些基于它构建。
#2
2
If you're using Cabal and you have the package installed, you can just try to compile it with cabal build
, and Cabal will inform you of which package you forgot to add to your dependencies:
如果您正在使用Cabal并且已安装了软件包,则可以尝试使用cabal构建进行编译,并且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.
#3
#4
0
If you are using Debian and the Debian-provided packages, there is a global documentation index at /usr/share/doc/ghc-doc/html/libraries/index.html
which lists the package in the last column.
如果您使用的是Debian和Debian提供的软件包,则/usr/share/doc/ghc-doc/html/libraries/index.html上有一个全局文档索引,其中列出了最后一列中的软件包。
#1
13
http://www.haskell.org/ghc/docs/latest/html/users_guide/packages.html
ghc-pkg find-module Text.Regex
ghc-pkg find-module Text.Regex
But that only works for (a) recent GHCs, and (b) packages installed on your system.
但这仅适用于(a)最近的GHC,以及(b)系统上安装的软件包。
You can also grep through the package file (e.g. /usr/lib/ghc-6.8.2/package.conf) to see what's installed.
您还可以浏览包文件(例如/usr/lib/ghc-6.8.2/package.conf)以查看已安装的内容。
You can also use either the haskell API search engines hoogle or the hackage search engine hayoo.
您还可以使用haskell API搜索引擎hoogle或hackage搜索引擎hayoo。
Text.Regex is in the package regex-base, and a few others built on top of it.
Text.Regex在包regex-base中,还有一些基于它构建。
#2
2
If you're using Cabal and you have the package installed, you can just try to compile it with cabal build
, and Cabal will inform you of which package you forgot to add to your dependencies:
如果您正在使用Cabal并且已安装了软件包,则可以尝试使用cabal构建进行编译,并且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.
#3
1
The best tools are:
最好的工具是:
Both are search engines for Haskell modules and functions.
两者都是Haskell模块和函数的搜索引擎。
#4
0
If you are using Debian and the Debian-provided packages, there is a global documentation index at /usr/share/doc/ghc-doc/html/libraries/index.html
which lists the package in the last column.
如果您使用的是Debian和Debian提供的软件包,则/usr/share/doc/ghc-doc/html/libraries/index.html上有一个全局文档索引,其中列出了最后一列中的软件包。