ghc-pkg 和 cabal 之间有什么关系?

发布于 2024-08-29 19:00:42 字数 309 浏览 5 评论 0原文

关于如何在 Haskell 中创建、安装和使用包, ghc-pkgcabal

它们的作用是什么——什么时候你会使用其中一个,而不是另一个,或者两者都使用?

它们是互补工具、竞争工具还是只是完成不同工作的工具?

With respect to how packages are created, installed and used in Haskell, what is the relationship between ghc-pkg and cabal?

What are their roles - when would you use one, over the other, or use both?

Are they complementary tools, competitive tools, or simply tools that do different jobs?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

美羊羊 2024-09-05 19:00:42

从图形上看,依赖关系是:

Packages GHC can use
    | 
Are registered with "ghc-pkg register"
    |
And (almost always) built with Cabal
    |
With build dependencies resolved by cabal-install
    |
From Hackage.

Graphically, the dependencies are:

Packages GHC can use
    | 
Are registered with "ghc-pkg register"
    |
And (almost always) built with Cabal
    |
With build dependencies resolved by cabal-install
    |
From Hackage.
删除→记忆 2024-09-05 19:00:42

ghc-pkg 是一个直接接口到 GHC 的包数据库。 Cabal 是一个为包提供一致的分发结构的工具,以及指定元数据(例如包之间的依赖关系、版本号和构建信息)的方法。

使用 Cabal 安装软件包会为您向 ghc 注册它(除其他外),但这确实是重叠的程度。

请注意,ghc-pkg 还提供了(据我所知)Cabal 没有的功能,例如隐藏已安装的软件包。

ghc-pkg is a direct interface to GHC's package database. Cabal is a tool that provides a consistent distribution structure for packages and a way to specify metadata such as dependencies between packages, version numbers, and build information.

Using Cabal to install a package will register it with ghc for you (among other things), but that's the extent of the overlap, really.

Note that ghc-pkg also provides functionality that (as far as I know) Cabal doesn't, such as hiding installed packages.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文