Search code examples
haskellcabalcabal-install

Cabal library vs cabal-install. what's the difference?


When I do cabal --version I see:

cabal-install version 0.14.0
using version 1.14.0 of the Cabal library 

so what's the difference? i thought that when i do cabal build i use only one program. why is it split into two separate programs with different versions?


Solution

  • The Cabal library defines how package descriptions are parsed and structured, and describe part of the process of building and installing a package. The cabal-install package defines the cabal application. It uses the library to effectively understand what a package description is.

    This is a common structure for software: implement all your pure and reusable business logic in a library (the Cabal library does most, but not all, of the work purely related to package descriptions), and implement all your user interface stuff and other 'details' in an application that uses the library (the cabal-install package defines the CLI tool, and implements the details of fetching packages from Hackage).