HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulebrick-2.10Haskell2010

Brick.BChan

  • 1 type
  • 5 values
  • Packagebrick-2.10
  • Exports6
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceBChan.hs
datadata BChan a
#

BChan is an abstract type representing a bounded FIFO channel.

valuenewBChan
  1. :: Int

    maximum number of elements the channel can hold

  2. -> IO (BChan a)
#

Builds and returns a new instance of BChan.

valuewriteBChan :: BChan a -> a -> IO ()
#

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

valuewriteBChanNonBlocking :: BChan a -> a -> IO Bool
#

Attempts to write a value to a BChan. If the channel has room, the value is written and this returns True. Otherwise this returns False and returns immediately.

valuereadBChan :: BChan a -> IO a
#

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

valuereadBChan2 :: BChan a -> BChan b -> IO (Either a b)
#

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