concurrency: Typeclasses, functions, and data types for concurrency and STM.
A typeclass abstraction over much of Control.Concurrent (and some extras!). If you're looking for a general introduction to Haskell concurrency, you should check out the excellent Parallel and Concurrent Programming in Haskell, by Simon Marlow. If you are already familiar with concurrent Haskell, just change all the imports from Control.Concurrent.* to Control.Concurrent.Classy.* and fix the type errors.
A brief list of supported functionality:
forkOn*functions, although bound threads are not supported.
Getting and setting capablities.
Yielding and delaying.
Mutable state: STM,
Atomic compare-and-swap for
All of the data structures in Control.Concurrent.* and Control.Concurrent.STM.* have typeclass-abstracted equivalents.
This is quite a rich set of functionality, although it is not complete. If there is something else you need, file an issue!
This used to be part of dejafu, but with the dejafu-0.4.0.0 release, it was split out into its own package.
Why this and not something else?
Why not base: like lifted-base, concurrency uses typeclasses to make function types more generic. This automatically eliminates calls to
liftin many cases, resulting in clearer and simpler code.
Why not lifted-base: fundamentally, lifted-base is still using actual threads and actual mutable variables. When using a concurrency-specific typeclass, this isn't necessarily the case. The dejafu library provides non-IO-based implementations to allow testing concurrent programs.
Why not IOSpec: IOSpec provides many of the operations this library does, however it uses a free monad to do so, which has extra allocation overhead. Furthermore, it does not expose enough of the internals in order to accurately test real-execution semantics, such as relaxed memory.
See the README for more details.
|Versions [faq]||22.214.171.124, 126.96.36.199, 188.8.131.52, 184.108.40.206, 220.127.116.11, 18.104.22.168, 22.214.171.124, 126.96.36.199, 188.8.131.52, 184.108.40.206, 220.127.116.11, 18.104.22.168, 22.214.171.124, 126.96.36.199, 188.8.131.52, 184.108.40.206, 220.127.116.11, 18.104.22.168, 22.214.171.124, 126.96.36.199, 188.8.131.52, 184.108.40.206, 220.127.116.11, 18.104.22.168, 22.214.171.124|
|Dependencies||array (==0.5.*), atomic-primops (==0.8.*), base (>=4.8 && <5), exceptions (>=0.7 && <0.9), monad-control (==1.0.*), mtl (==2.2.*), stm (==2.4.*), transformers (>=0.4 && <0.6) [details]|
|Source repo||head: git clone https://github.com/barrucadu/dejafu.git
this: git clone https://github.com/barrucadu/dejafu.git(tag concurrency-126.96.36.199)
|Uploaded||by barrucadu at 2017-02-21T04:29:25Z|
|Distributions||LTSHaskell:188.8.131.52, NixOS:184.108.40.206, Stackage:220.127.116.11|
|Downloads||16246 total (156 in the last 30 days)|
|Rating||(no votes yet) [estimated by Bayesian average]|
Docs available [build log]
Last success reported on 2017-02-21 [all 1 reports]
For package maintainers and hackage trustees