Chan
Chan is an abstract type representing an unbounded FIFO channel.
Unbounded channels.
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
Version 0.3.0
change-monger is intended to allow you to extract the revision history from various VCSes like Darcs, and save them as a ChangeLog; particularly important is being able to extract the summaries for all patches since the last release.
Version 0.0
CHANGEATTRS is a more expressive alternative to ADDATTRS
changeWorkingDirectory dir calls chdir to change the current working directory to dir.
changeWorkingDirectory dir calls chdir to change the current working directory to dir.
Duplicate a Chan: the duplicate channel begins empty, but data written to either channel from then on will be available from both. Hence this creates a kind of broadcast channel, anyone is seen by everyone else.
Return a lazy list representing the contents of the supplied Chan, much like System.IO.hGetContents.
Returns True if the supplied Chan is empty.
Build and returns a new instance of Chan.
Read the next value from the Chan.
Put a data item back onto a channel, read.
Write an entire list of items to a Chan.
Bounded TChan's, or BTChan's, are a transactional queue with a limit to the number of elements (further calls to writeBTChan or unGetBTChan call STM retry). Users are strongly encouraged to consider using the more complete 'stm-chans' packages, which includes a bounded TChan designed on this package.
Version 0.2.3
This library introduces BoundedChan. BoundedChans differ from Chans in that they are guaranteed to contain no more than a certain number of elements.
Version 1.0.1.0
TChan: Transactional channels (GHC only)
Show more results