We have created a moderately complicated library, with four public modules and one internal module. To turn this into a package that we can easily redistribute, we create a rwh-bloomfilter.cabal file.
Cabal allows us to describe several libraries in a single package. A .cabal file begins with information that is common to all of the libraries, which is followed by a distinct section for each library:
Name: rwh-bloomfilter Version: 0.1 License: BSD3 License-File: License.txt Category: Data Stability: experimental Build-Type: Simple
As we are bundling some C code with our library, we tell Cabal about our C source files:
Extra-Source-Files: cbits/lookup3.c cbits/lookup3.h
directive has no effect on a build: it directs Cabal to bundle some
extra files if we run runhaskell Setup
sdist to create a source tarball for redistribution.
When reading a property (the text
before a “
character), Cabal ignores case, so it treats
Prior to 2007, the standard Haskell libraries were
organized in a handful of large packages, of which the biggest was
base. This organization tied many unrelated
libraries together, so the Haskell community split the
base package up into a number of more modular libraries.
For instance, the array types migrated from
base into a
A Cabal package needs to specify the other packages that ...