Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Chan with size
Synopsis
- data SizedChan a
- newSizedChan :: IO (SizedChan a)
- writeSizedChan :: SizedChan a -> a -> IO ()
- readSizedChan :: SizedChan a -> IO a
- tryReadSizedChan :: SizedChan a -> IO (Maybe a)
- peekSizedChan :: SizedChan a -> IO a
- tryPeekSizedChan :: SizedChan a -> IO (Maybe a)
- isEmptySizedChan :: SizedChan a -> IO Bool
Documentation
readSizedChan :: SizedChan a -> IO a Source #
Read the next value from the SizedChan
. Blocks when the channel is empty.
tryReadSizedChan :: SizedChan a -> IO (Maybe a) Source #
A version of readSizedChan
which does not block. Instead it returns Nothing if no value is available.
peekSizedChan :: SizedChan a -> IO a Source #
Peek the next value from the SizedChan
without removing it. Blocks when the channel is empty.
tryPeekSizedChan :: SizedChan a -> IO (Maybe a) Source #
A version of peekSizedChan
which does not block. Instead it returns Nothing if no value is available.