What is the relationship between ghc-pkg and cabal?

前端 未结 2 1977
长情又很酷
长情又很酷 2021-02-01 03:05

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 on

2条回答
  •  梦如初夏
    2021-02-01 03:16

    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.

提交回复
热议问题