8b28633f20
Shrinking attempts to find a "maximally simple" trace which exhibits the same bug as the original. Typically, this means that the results are equal. Shrinking is implemented in terms of recursively trying to find the simplest variant of the original trace, where simplest in particular means: 1. A trace with fewer pre-emptions is simpler. 2. A trace with fewer non-pre-emptive context switches is simpler. 3. A trace lexicographically smaller is simpler. These three criteria are applied in that order in order to determine which the simplest trace out of a collection is. For test output, there is a final set of simplification done at the end. Shrinking attempts to reduce individual traces to their simplest variant, which can result in multiple test failures having the same shrunk trace. Thus, the test runner then filters out duplicate failures by only keeping the simplest trace for a given result. |
||
---|---|---|
Control | ||
Data/List | ||
tests | ||
.gitignore | ||
.travis.yml | ||
LICENSE | ||
monad-conc.cabal | ||
README.markdown | ||
Setup.hs |
monad-conc
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 family of monads for potentially
nondeterministic concurrency, with an interface very much in the
spirit of Par
, but slightly more relaxed. Specifically, Conc
's
IVar
equivalent, CVar
s, can be written to multiple times.
The documentation of the latest developmental version is available online.
Conc
and IO
The intention of the Conc
monads is to provide concurrency where any
apparent nondeterminism arises purely from the scheduling
behaviour. To put it another way, a given Conc
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).