Portability | POSIX |
---|---|
Stability | experimental |
Maintainer | bastianholst@gmx.de |
Safe Haskell | Safe-Inferred |
A simple stack implementation with an concurrent STM access functions similar to
that of TChan
. In contrast to TChan
, which is a FIFO buffer,
TStack
is a LIFO buffer.
- data TStack a
- newTStack :: STM (TStack a)
- writeTStack :: TStack a -> a -> STM ()
- readTStack :: TStack a -> STM a
- isEmptyTStack :: TStack a -> STM Bool
- tryReadTStack :: TStack a -> STM (Maybe a)
Documentation
writeTStack :: TStack a -> a -> STM ()Source
Write a value into the TStack
.
readTStack :: TStack a -> STM aSource
Read the next value from the TStack
.