/longrun

Long running process support routines for haskell.

Primary LanguageHaskellGNU General Public License v3.0GPL-3.0

longrun

longrun is a Haskell library for working with hierarchies of long running Haskell threads.

Development

Development is done inside a nix shell that provides all the dependencies. To enter run nix-shell at the project root - this requires nix on your machine. The rest of the section assumes you will be running commands inside the nix shell.

Building

Use regular cabal commands (cabal is already provided by nix)

cabal configure
cabal build -j

If you require profiling you can obtain an environment with libraries build with profiling by running (directly on your machine, not in the dev shell)

nix-shell -A withProfiling

and then in the development shell

cabal configure --enable-library-profiling
cabal build -j

Testing

Use regular cabal test command (cabal is already provided by nix)

cabal test -j --test-option=--color --show-details=always [testName]

Some tests are repeatedly running the same code and observing for memory leaks. You can multiply the number of runs by setting ITERATION_MULTIPLIER env variable before running the tests. For example this will make the tests run 100x longer:

ITERATION_MULTIPLIER=100 cabal test ...

Generate documentation

Use regular cabal haddock command (cabal is already provided by nix)

cabal haddock

Changing dependencies

Nix packaging of this library is done by having an auto-generated default.nix file and a manually maintained shell.nix. After changing dependencies in longrun.cabal you will need to run the following command to update default.nix:

cabal2nix . > default.nix

If you don't have cabal2nix on your machine use nix-shell -p cabal2nix to get a temporary shell with it available.

If you need to provide system dependencies then edit mkEnv function in shell.nix. The buildInputs part defines system packages provided in the development shell.

Authors

This library is written and maintained by Zoran Bošnjak, zoran.bosnjak@sloveniacontrol.si.