Overview
Bazel

Overview

Core Haskell rules

Rules

haskell_binary

Build an executable from Haskell source.

haskell_import

Import packages that are prebuilt outside of Bazel.

haskell_library

Build a library from Haskell source.

haskell_test

Build a test suite.

Haddock support

Rules

haskell_doc

Create API documentation.

Linting

Rules

haskell_lint

Check source code of targets in deps using a restrictive set of GHC flags.

Rules for defining toolchains

Macros

haskell_toolchain

Declare a compiler toolchain.

Support for protocol buffers

Rules

haskell_proto_library

Generate Haskell library allowing to use protobuf definitions with help of proto-lens.

Macros

haskell_proto_toolchain

Declare a Haskell protobuf toolchain.

Interop with cc_* rules

Rules

cc_haskell_import

Exports a Haskell library as a CC library.

haskell_cc_import

Imports a prebuilt shared library.

Macros

cc_interop_info

Gather information from any CC dependencies.

Workspace rules (repositories)

Macros

haskell_repositories

Provide all repositories that are necessary for rules_haskell to function.

Workspace rules (GHC binary distributions)

Repository Rules

ghc_bindist

Create a new repository with given name which will contain two targets:

Loading of haskell packages from nixpkgs

Macros

haskell_nixpkgs_package

Load a single haskell package. The package is expected to be in the form of the packages generated by genBazelBuild.nix

haskell_nixpkgs_packages

Import a set of haskell packages from nixpkgs.

haskell_nixpkgs_packageset

Import all the available haskell packages. The arguments are the same as the arguments of nixpkgs_package, except for the base_attribute_path which should point to an haskellPackages set in the nix expression