Overview
Bazel

Overview

Core Haskell rules

Rules

haskell_binary

Build an executable from Haskell source.

haskell_library

Build a library from Haskell source.

haskell_test

Build a test suite.

haskell_toolchain_library

Import packages that are prebuilt outside of Bazel.

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.

haskell_register_toolchains

Download the binary distribution of GHC for your current platform and register it as a toolchain. This currently has the same effect as just haskell_register_ghc_bindists(version).

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)

Macros

ghc_bindist

Create a new repository from binary distributions of GHC. The repository exports two targets:

haskell_register_ghc_bindists

Register GHC binary distributions for all platforms as toolchains.

Workspace rules (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

haskell_register_ghc_nixpkgs

Register a package from Nixpkgs as a toolchain.