Copyright | (c) 2016 Michael Walker |
---|---|
License | MIT |
Maintainer | Michael Walker <mike@barrucadu.co.uk> |
Stability | stable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Unbounded channels.
Deviations: Chan
as defined here does not have an Eq
instance, this is because the MonadConc
MVar
type does not have
an Eq
constraint. The deprecated unGetChan
and isEmptyCHan
functions are not provided. Furthermore, the getChanContents
function is not provided as it needs unsafe I/O.
The Chan
type
Chan
is an abstract type representing an unbounded FIFO
channel.
Since: concurrency-1.0.0.0
Operations
newChan :: MonadConc m => m (Chan m a) Source #
Build and returns a new instance of Chan
.
Since: concurrency-1.0.0.0
writeChan :: MonadConc m => Chan m a -> a -> m () Source #
Write a value to a Chan
.
Since: concurrency-1.0.0.0
readChan :: MonadConc m => Chan m a -> m a Source #
Read the next value from the Chan
.
Since: concurrency-1.0.0.0
dupChan :: MonadConc m => Chan m a -> m (Chan m a) Source #
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, where data written
by anyone is seen by everyone else.
Since: concurrency-1.0.0.0