Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data RingBuffer a
- new :: Prim a => Int -> IO (RingBuffer a)
- clear :: Prim a => RingBuffer a -> IO ()
- append :: Prim a => a -> RingBuffer a -> IO ()
- capacity :: Prim a => RingBuffer a -> IO Int
- filledLength :: Prim a => RingBuffer a -> IO Int
- latest :: Prim a => RingBuffer a -> Int -> IO (Maybe a)
- foldMap :: (Prim a, Monoid b) => RingBuffer a -> (a -> IO b) -> IO b
Documentation
data RingBuffer a Source #
:: Prim a | |
=> Int | capacity of buffer |
-> IO (RingBuffer a) |
Return a new ring buffer of the specified size.
capacity :: Prim a => RingBuffer a -> IO Int Source #
Get the maximum number of items the ring can contain
filledLength :: Prim a => RingBuffer a -> IO Int Source #
Get the current filled length of the ring