Copyright | (c) 2008-2020 Bertram Felgenhauer |
---|---|
License | MIT |
Maintainer | Bertram Felgenhauer <int-e@gmx.de> |
Stability | experimental |
Portability | ghc |
Safe Haskell | None |
Language | Haskell2010 |
An IChan
s is a type of multicast channel built on top of IVar
s.
It supports multiple readers. The channel is represented as a linked
list. The IChan
data type represents the head of a channel.
Writing to an IChan
head has write-once semantics similar to IVar
s:
only the first of several attempts to write to the head will succeed,
returning a new IChan
head for writing more values.
Documentation
A channel head
read :: IChan a -> [a] Source #
Returns the contents of a channel as a list, starting at the channel head.
This is a pure computation. Forcing elements of the list may, however, block.
uncons :: IChan a -> (a, IChan a) Source #
Split channel into head and tail.
This is a pure operation, but it may block.
Since: 0.3.3