Haskell is well supported on Arch Linux, with GHC and other key tools available via pacman, a growing number of packages made available by the ArchHaskell group, and a large part of hackage.haskell.org library database available via AUR.

The community around Haskell on Arch is active and well organized but your help is always welcome.

AUR

These generally improve on installing directly from Hackage as they resolve required C libraries. They can be installed as, for example:

sudo paktahn -S haskell-csv

Anything not found here can be installed via cabal-install direct from Hackage.

Guidelines

In almost all cases cabalised Haskell packages can be automatically translated into Arch packages, via the cabal2arch tool. It is strongly recommended that you use the latest released version of this tool, as it implements the packaging policy for Haskell packages. You can get it in several ways:

Add the [haskell] repository to pacman.conf and use pacman do install the latest release.

All libraries that the package depend on are listed (libraries shipped with ghc are dealt with by having the ghc package provide them)

It uses cabal to generate a post-install register/unregister script, with a standard name.

We use haddock to build the documentation.

All Haskell libraries should follow these naming conventions, and using the latest release of cabal2arch will ensure this is the case.

NOTE: Beginning with cabal2arch 1.1-2, a new environment variable, PKGBUILD_HASKELL_ENABLE_PROFILING, is generated into the PKGBUILD. If this variable is of non-zero length, such as "1" or "true", then profiling builds will occur. Thus, if a user desires profiling, then it is advised to export this environment variable in a file such as ~/.bashrc or ~/.zshrc.

Guidelines for Libraries

In general, each .cabal file should map to one PKGBUILD. The following conventions hold:

libraries have their cabal names prefixed with "haskell-"

all libraries have a dependency on 'ghc'

all libraries that are depended on must be listed in the depends-array in the PKGBUILD

be careful about dependencies from gtk2hs: cairo, svg, glib, gtk. These are all provided by the 'gtk2hs' package, not , e.g. "haskell-cairo"

Registering Haskell libraries is done via a register hook, see above.

Guidelines for Programs

Have their normal name. Examples: hmp3, xmonad, ghc, cabal-install

Be careful about dynamically linked runtime dependencies on C. For example, all GHC-produced binaries have a runtime dependency on 'gmp'. OpenGL or GtT-based binaries will have additional 'depends'. cabal2arch will attempt to work out the C dependencies, but there may be others implied by Haskell dependencies that are missed.

Use executable stripping, --enable-executable-stripping. cabal2arch will do this automatically.

Automatic local building of Hackage Packages with cabal2arch using Bauerbill

Warning:Bauerbill development has been officially discontinued: its latest version does not work with pacman>=3.5. See [1].

Although there are a number of haskell packages on AUR, there will always be outdated packages on AUR. If this happens and you want to create a fully updated package you would normally use cabal2arch. This however can become painful/time consuming if you have numerous packages with different dependencies (some of which may/may not be updated). Instead you can automatic this process by using Bauerbill which has the --hackage flag, allowing you to create AUR packages from Hackage locally. Below is an example of some common commands

Syncing packages with the --hackage flag will interactively download all dependencies of the package from Hackage, convert them using cabal2arch and then build/install them (while checking dependencies). You can combine this with the --aur flag to give precedence to Hackage packages that are on AUR