chan-split: Concurrent Chans as read/write pairs. Also provides generic Chan, Cofunctor classes.
A wrapper around Control.Concurrent.Chan that splits a Chan into a pair, one of which allows only read operations, the other write operations.
This makes code easier to reason about, allows us to define
useful instances (Functor
and Cofunctor
) on the chan
pairs.
In addition this package provides a module that defines a
pair of classes ReadableChan
and WritableChan
which
defines the basic methods any Chan type should provide.
To use standard Chans with these polymorphic functions, import as follows:
import Control.Concurrent.Chan hiding (readChan,writeChan,writeList2Chan) import Control.Concurrent.Chan.Class
When used alongside standard Chans, the Split module can be imported qualified like:
import qualified Control.Concurrent.Chan.Split as S
Note, we do not implement the deprecated unGetChan and isEmptyChan functions.
This module is used internally by the simple-actors package.
Downloads
- chan-split-0.1.2.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
Versions [RSS] | 0.1.2, 0.1.3, 0.2.0, 0.3.0, 0.4.0, 0.5.0 |
---|---|
Dependencies | base (>=4 && <5) [details] |
License | BSD-3-Clause |
Author | Brandon Simmons |
Maintainer | brandon.m.simmons@gmail.com |
Category | Concurrency |
Home page | http://coder.bsimmons.name/blog/2011/07/module-chan-split-released/ |
Uploaded | by BrandonSimmons at 2011-07-18T00:28:31Z |
Distributions | NixOS:0.5.0 |
Reverse Dependencies | 2 direct, 0 indirect [details] |
Downloads | 5181 total (24 in the last 30 days) |
Rating | (no votes yet) [estimated by Bayesian average] |
Your Rating | |
Status | Docs uploaded by user Build status unknown [no reports yet] |