ghc-pkg 和 cabal 之间有什么关系?
关于如何在 Haskell 中创建、安装和使用包, ghc-pkg 和 cabal?
它们的作用是什么——什么时候你会使用其中一个,而不是另一个,或者两者都使用?
它们是互补工具、竞争工具还是只是完成不同工作的工具?
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从图形上看,依赖关系是:
Graphically, the dependencies are:
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.