The chan-split package

[Tags: bsd3, library]

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 Contravariant) 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.

CHANGES: 0.1.3 -> 0.2.0 - get Cofunctor from contravariant package - redefine chan pair classes using fundeps to express the relationship between input and output halfs of a Chan - define NewSplitChan class for chan pairs that can be instantiated


Properties

Versions0.1.2, 0.1.3, 0.2.0, 0.3.0, 0.4.0, 0.5.0
Dependenciesbase (==4.*), contravariant
LicenseBSD3
AuthorBrandon Simmons
Maintainerbrandon.m.simmons@gmail.com
CategoryConcurrency
Home pagehttp://coder.bsimmons.name/blog/2011/07/module-chan-split-released/
Source repositoryhead: git clone https://github.com/jberryman/chan-split.git
Upload dateTue Sep 20 19:30:31 UTC 2011
Uploaded byBrandonSimmons
Downloads490 total (35 in last 30 days)

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees