成功安装到 运行 这段代码的哪个包

Which package to install to run this code successfully

我正在尝试遵循 here 中的简单代码:

import Data.GI.Base
import qualified GI.Gtk as Gtk

main :: IO()
main = do
  Gtk.init Nothing
  Gtk.main

但是,我收到以下错误:

    Could not find module `Data.GI.Base'
    Use -v to see a list of the files searched for.
  |
1 | import Data.GI.Base
  | ^^^^^^^^^^^^^^^^^^^

simplewin.hs:2:1: error:
    Could not find module `GI.Gtk'
    Use -v to see a list of the files searched for.
  |
2 | import qualified GI.Gtk as Gtk
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

以下安装包的尝试未找到任何匹配项:

>cabal list Data.GI.Base
No matches found.

>cabal list GI.Gtk
No matches found.

我应该使用 cabal 安装哪些软件包来纠正上述错误?

您可以搜索 Stackage(FPComplete 包存储库,Haskell 的实际标准)以查找模块、类型或函数名称。

例如,当我输入 Data.GI.Base 时,我得到 its documentation page,它告诉我(在最顶部)模块在包 haskell-gi-base 中可用。

虽然不是每个包都可以在 Stackage 上使用。如果找不到,请尝试 Hackage 接下来。它的监管和控制较少,但因此有更多的东西。