The Haskell community has built a standard set of tools, named Cabal, that help with building, installing, and distributing software. Cabal organizes software as a package. A package contains one library, and possibly several executable programs.
To do anything with a package, Cabal needs a description of it. This is contained in a text file whose name ends with the suffix .cabal. This file belongs in the top-level directory of your project. It has a simple format, which we’ll describe next.
A Cabal package must have a name.
Usually, the name of the package matches the name of the .cabal file. We’ll call our package
mypretty, so our file is mypretty.cabal. Often, the directory that
contains a .cabal file will have
the same name as the package, e.g.,
A package description begins with a series of global properties, which apply to every library and executable in the package:
Name: mypretty Version: 0.1 -- This is a comment. It stretches to the end of the line.
Package names must be unique. If you create and install a package that has the same name as a package already present on your system, GHC will get very confused.
The global properties include a substantial amount of information that is intended for human readers, not Cabal itself:
Synopsis: My pretty printing library, with JSON support Description: A simple pretty-printing library that illustrates how to develop a Haskell library. Author: Real World Haskell Maintainer: email@example.com ...