Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
exec/cat_hs remove redundant imports in examples/cat_hs Aug 15, 2019
lib remove redundant imports in examples/cat_hs Aug 15, 2019
BUILD.bazel Bring back cat_hs example Aug 13, 2019 Amend cwd for cat_hs README build commands Aug 13, 2019

cat_hs - A rules_haskell Example Project

This project re-implements a subset of the cat command-line tool in Haskell. It serves as an example of a project built using the Bazel build system, using rules_haskell to define the Haskell build, including rules that wrap Cabal to build third-party dependencies downloadable from Hackage, and using rules_nixpkgs and Nix to manage system dependencies.


You need to install the Nix package manager. All further dependencies will be managed using Nix.


To build the package execute the following command in the examples/ directory:

$ nix-shell --pure --run "bazel build //cat_hs/..."

To run the tests execute the following command.

$ nix-shell --pure --run "bazel test //cat_hs/..."

To run the executable enter the following commands.

$ nix-shell --pure --run "bazel run //cat_hs/exec/cat_hs -- -h"
$ nix-shell --pure --run "bazel run //cat_hs/exec/cat_hs -- $PWD/"
You can’t perform that action at this time.