|Copyright||(c) The University of Glasgow 2001|
|License||BSD-style (see the file libraries/base/LICENSE)|
The channels are implemented with
MVars and therefore inherit all the
caveats that apply to
MVars (possibility of races, deadlocks etc). The
stm (software transactional memory) library has a more robust implementation
of channels called
Chan is an abstract type representing an unbounded FIFO channel.
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, where data written by anyone is seen by
(Note that a duplicated channel is not equal to its original.
fmap (c /=) $ dupChan c returns
True for all
Deprecated: if you need this operation, use Control.Concurrent.STM.TChan instead. See http://ghc.haskell.org/trac/ghc/ticket/4154 for details
Put a data item back onto a channel, where it will be the next item read.