Haskell on Heroku

A Heroku buildpack for deploying Haskell apps.

Haskell on Heroku is a Heroku buildpack for deploying Haskell apps. The buildpack uses Halcyon to install apps and development tools, including GHC and Cabal.

Follow the tutorial to get a first app deployed, or browse the usage notes for invocation details. Example apps can be deployed to Heroku in one click.

The Haskell on Heroku buildpack provides a streamlined path for deploying Haskell applications to the Heroku platform without manual environment configuration. It abstracts away the complexities of setting up a cloud runtime, allowing developers to focus on writing code rather than managing infrastructure. By integrating directly with Heroku's deployment pipeline, the buildpack ensures that applications are built consistently and reliably each time changes are pushed.

At the core of the buildpack lies Halcyon, a tool that handles the installation of Haskell applications and their associated development dependencies. This includes provisioning the Glasgow Haskell Compiler and Cabal, the standard build system for Haskell projects. Halcyon caches compiled artifacts intelligently, which reduces subsequent build times and makes the iterative development cycle feel responsive even when deploying to remote environments.

Deploying an application with this buildpack follows a familiar Git-based workflow. A developer simply pushes code to a Heroku remote, and the buildpack automatically detects the Haskell project, fetches its dependencies, compiles the source, and prepares the resulting executable for production use. This tight integration with version control means that deployment becomes a natural extension of the development process rather than a separate, error-prone procedure.

The buildpack supports a range of development tools beyond the basic compiler and build system. By leveraging Halcyon's sandboxed environment, it becomes possible to specify particular versions of GHC and Cabal on a per-project basis, ensuring reproducible builds across different machines and over time. This version pinning capability is essential for teams that need consistent behaviour between local development setups and production deployments.

Comprehensive documentation accompanies the buildpack, including a tutorial that walks newcomers through the process of getting their first Haskell application running on Heroku. The reference material covers invocation details, environment variables, and configuration options that allow fine-tuning of the build process. Additional examples demonstrate common patterns, making it easier to understand how real-world applications should be structured for deployment.

The buildpack itself is written in GNU Bash, making it transparent and easy to inspect for those who wish to understand its internals. Its design draws inspiration from similar tools in the functional programming ecosystem, including buildpacks created for other languages. The source code is available for review, and contributions or issue reports are handled through a public tracker, fostering a collaborative approach to ongoing development and maintenance.

For developers evaluating deployment options, the buildpack offers practical advantages in terms of build speed and resulting application footprint. Because Halcyon caches pre-built binaries and shares them across deployments, the time required to go from a code change to a live update is kept to a minimum. This efficiency makes the buildpack suitable not only for production applications but also for rapid prototyping and demonstration projects.

The project is maintained independently and is not officially affiliated with Heroku or any particular commercial entity. Support is available through community channels, including an IRC channel where users can ask questions and share experiences. The software is released under a permissive open-source license, encouraging adoption and adaptation by anyone interested in deploying Haskell applications to cloud platforms.

Configure Deployment

Data sourced from Heroku buildpack documentation, Halcyon project notes, and verified issue trackers.

Site Sections