Systematic concurrency testing meets Haskell.
Go to file
Michael Walker 7aceb6a6f9 Implement an atomic-for-testing-purposes function.
This adds a new `MonadConc` primitive, `_concNoTest`, which is (for
all non-test implementations) the identity function. For test
implementations, it is understood as "this action is completely safe
under all schedules, so just execute it all at once and don't consider
any internal interleavings." It is not required to be deterministic,
merely to never fail.

Actions annotated with `_concNoTest` will show up as one step in the
trace, and new `Failure` and `ThreadAction` values have been added.
2015-02-06 16:18:25 +00:00
Control Implement an atomic-for-testing-purposes function. 2015-02-06 16:18:25 +00:00
Data/List Better dupe elimination 2015-02-04 16:51:50 +00:00
Test Implement an atomic-for-testing-purposes function. 2015-02-06 16:18:25 +00:00
tests Include reason for failure in Deterministic result 2015-02-06 16:04:59 +00:00
.gitignore Initial commit: a class for monads providing concurrency. 2014-12-18 11:03:17 +00:00
.travis.yml Only put the master branch through travis 2015-01-15 07:37:28 +00:00
dejafu.cabal Remove shrinking. 2015-02-04 11:45:08 +00:00
LICENSE Initial commit: a class for monads providing concurrency. 2014-12-18 11:03:17 +00:00
README.markdown Rename and remodularise 2015-01-31 15:50:54 +00:00
Setup.hs Initial commit: a class for monads providing concurrency. 2014-12-18 11:03:17 +00:00

dejafu Build Status

Concurrency is nice, deadlocks and race conditions not so much. The Par monad family, as defined in abstract-par provides deterministic parallelism, but sometimes we can tolerate a bit of nondeterminism.

This package provides a class of monads for potentially nondeterministic concurrency, with an interface very much in the spirit of Par, but slightly more relaxed. Specifically, MonadConc's IVar equivalent, CVars, can be written to multiple times.

The documentation of the latest developmental version is available online.

MonadConc and IO

The intention of the MonadConc class is to provide concurrency where any apparent nondeterminism arises purely from the scheduling behaviour. To put it another way, a given computation, parametrised with a fixed set of scheduling decisions, is deterministic. This assumption is used by the testing functionality provided by Control.Monad.Conc.SCT.

Whilst this assumption may not hold in general when IO is involved, you should strive to produce test cases where it does.

Contributing

Bug reports, pull requests, and comments are very welcome!

Feel free to contact me on GitHub, through IRC (#haskell on freenode), or email (mike@barrucadu.co.uk).