reactive-0.11.4: Push-pull functional reactive programmingSource codeContentsIndex
Portabilitynon-portable (concurrency)
The Chan type
Stream interface
New stuff
Unbounded channels.
data Chan a
newChan :: IO (Chan a)
writeChan :: Chan a -> a -> IO ()
readChan :: Chan a -> IO a
dupChan :: Chan a -> IO (Chan a)
unGetChan :: Chan a -> a -> IO ()
isEmptyChan :: Chan a -> IO Bool
getChanContents :: Chan a -> IO [a]
writeList2Chan :: Chan a -> [a] -> IO ()
weakChanWriter :: Chan a -> IO (IO (Maybe (a -> IO ())))
The Chan type
data Chan a Source
Chan is an abstract type representing an unbounded FIFO channel.
show/hide Instances
newChan :: IO (Chan a)Source
Build and returns a new instance of Chan.
writeChan :: Chan a -> a -> IO ()Source
Write a value to a Chan.
readChan :: Chan a -> IO aSource
Read the next value from the Chan.
dupChan :: Chan a -> IO (Chan 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.
unGetChan :: Chan a -> a -> IO ()Source
Put a data item back onto a channel, where it will be the next item read.
isEmptyChan :: Chan a -> IO BoolSource
Returns True if the supplied Chan is empty.
Stream interface
getChanContents :: Chan a -> IO [a]Source
Return a lazy list representing the contents of the supplied Chan, much like System.IO.hGetContents.
writeList2Chan :: Chan a -> [a] -> IO ()Source
Write an entire list of items to a Chan.
New stuff
weakChanWriter :: Chan a -> IO (IO (Maybe (a -> IO ())))Source
A weak channel writer. Sustained by the read head. Thus channel consumers keep channel producers alive.
Produced by Haddock version 2.7.2