As I know cabal is a program to manage installation of packages like FreeBSD's pkg_add.
But there is another tool called ghc-pkg. I don't know why there are two different programs. What's the role of each of them and how are they related?
How are `ghc-pkg` and `cabal` programs related? (Haskell)
1.3k Views Asked by eonil At
2
Cabal is a building and packaging library for Haskell, kind of "Haskell autotools". It reads
.cabalfiles and Haskell packages usually have a fileSetup.hswhich uses Cabal to build the package. Then there's alsocabalcommand provided by the cabal-install package. It provides commands for runningSetup.hsscript and some package management functions, like installing packages directly from Hackage. You should read this blogpost by Ivan Miljenovic which explains the role of Cabal, cabal-install and Hackage quite well.ghc-pkgis a lower-level tool for poking GHC's package database. Cabal is intended to work with every Haskell compiler, whereas ghc-pkg is obviously specific to GHC. You can't use ghc-pkg to build anything, you can just register packages you've built otherwise.