The recommended way to distribute your Haskell projects is to use Cabal . Cabal is both a build system and a package manager for Haskell code, and it makes it easy to collect Haskell code on different platforms when handling dependencies for you.
Here is an example cabal file:
Name: MyPackage Version: 0.0 Cabal-Version: >= 1.2 License: BSD3 Author: Angela Author Synopsis: Small package an utility program Build-Type: Simple Executable myutility Build-Depends: base Main-Is: Main.hs Hs-Source-Dirs: src
You can create a cabal file interactively by running
$ cabal init
Then Kabbalah will ask you some simple questions and create a Kabbalah file based on your answers. Then you can customize this file to suit your specific needs.
To install a package, simply run it in the package directory
$ cabal install
You can also upload your package to Hackage , the standard Haskell package repository. This way, people can download and install your package (and any dependencies) in one step with the command
$ cabal install mypackage
There are also tools for converting Cabal packages to other package managers if you do not want your users to install Cabal (although Cabal is included in the Haskell Platform ).
It also works well with Haddock to create reference documentation for your package. Check out some packages in Hackage for sample results.
Work is also underway to improve Cabal test suite support.
All in all, these reasons, and many others, make great use of Cabal to organize, build, and distribute your Haskell projects.
hammar
source share