Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Helpers for processing messages in sequence.
Synopsis
- data Sequential counter item
- sequenceBy :: (Hashable counter, Eq counter) => (a -> counter) -> counter -> STM (Sequential counter a)
- insert :: (Ord counter, Enum counter, Hashable counter, Eq counter) => Sequential counter a -> a -> STM Bool
- next :: (Enum counter, Eq counter, Hashable counter) => Sequential counter a -> STM a
Documentation
data Sequential counter item Source #
A thing that gets numbered items and then buffers them so you can read them in order without gaps.
"counter" is an Enum
that is used to determine the ordering of the
elements, and "item" is the type of the items themselves.
:: (Hashable counter, Eq counter) | |
=> (a -> counter) | How to rank items |
-> counter | The expected rank of the first item |
-> STM (Sequential counter a) |
Create a Sequential
value for a series of item.