License | BSD-3-Clause |
---|---|
Maintainer | Jamie Willis |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Exposes the core shared operations of queue implementations.
Since: 1.5.0.0
Documentation
class QueueLike q where Source #
Operations on a queue-like structure q
. These operations should be
efficient, with amortized constant complexity for all of them except enqueueAll
.
Since: 1.5.0.0
Construct an empty queue.
Since: 1.5.0.0
Is the queue empty?
Since: 1.5.0.0
Returns how many elements are in the queue.
Since: 1.5.0.0
enqueue :: a -> q a -> q a Source #
Adds an element onto the end of the queue.
Since: 1.5.0.0
dequeue :: q a -> (a, q a) Source #
Removes an element from the front of the queue.
Since: 1.5.0.0
enqueueAll :: [a] -> q a -> q a Source #
Adds each of the elements onto the queue, from left-to-right.
Since: 1.5.0.0
Instances
QueueLike Queue Source # | |
QueueLike RewindQueue Source # | |
Defined in Parsley.Internal.Common.RewindQueue empty :: RewindQueue a Source # null :: RewindQueue a -> Bool Source # size :: RewindQueue a -> Int Source # enqueue :: a -> RewindQueue a -> RewindQueue a Source # dequeue :: RewindQueue a -> (a, RewindQueue a) Source # enqueueAll :: [a] -> RewindQueue a -> RewindQueue a Source # |