Building a Haskell Project

What This Guide Covers

Language versions and other build-environment specific information are in our reference pages:

The rest of this guide covers configuring Haskell projects on Travis CI. If you’re new to Travis CI please read our Getting Started and build configuration guides first.

Specifying Haskell compiler versions

The Haskell environment on Travis CI has recent versions of GHC (Glasgow Haskell Compiler) pre-installed. For a detailed list of pre-installed versions, please consult “Build system information” in the build log.

You can specify one or more GHC versions using major.minor notation. Patch level versions (7.6.2 for example) may change any time:

  - 7.8
  - 7.6
  - 7.4

Default Build Script

The default Haskell build script is:

cabal configure --enable-tests && cabal build && cabal test

Dependency Management

By default Travis CI uses cabal to manage your project’s dependencies:

cabal install --only-dependencies --enable-tests

Build Matrix

For Haskell projects, env and ghc can be given as arrays to construct a build matrix.