brick-0.34.1: A declarative terminal user interface library

Safe HaskellSafe




data BChan a Source #

BChan is an abstract type representing a bounded FIFO channel.

newBChan Source #


:: Int

maximum number of elements the channel can hold

-> IO (BChan a) 

Builds and returns a new instance of BChan.

writeBChan :: BChan a -> a -> IO () Source #

Writes a value to a BChan; blocks if the channel is full.

readBChan :: BChan a -> IO a Source #

Reads the next value from the BChan; blocks if necessary.

readBChan2 :: BChan a -> BChan b -> IO (Either a b) Source #

Reads the next value from either BChan, prioritizing the first BChan; blocks if necessary.