2008-09-26 56 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處有一個全局文檔索引,其中列出了最後一列中的軟件包。