HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulebrick-3.0Haskell2010

Brick.BChan

  • 1 type
  • 5 values
  • Packagebrick-3.0
  • 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.