| License | BSD-3-Clause | 
|---|---|
| Maintainer | Jamie Willis | 
| Stability | experimental | 
| Safe Haskell | Safe-Inferred | 
| Language | Haskell2010 | 
Parsley.Internal.Common.QueueLike
Description
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
Methods
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
poke :: (a -> a) -> q a -> (a, q a) Source #
modifies the head of the queue, without removal. Returns the old head
Since: 2.1.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 # | |
Defined in Parsley.Internal.Common.Queue  | |
| QueueLike RewindQueue Source # | |
Defined in Parsley.Internal.Common.RewindQueue Methods 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 # poke :: (a -> a) -> RewindQueue a -> (a, RewindQueue a) Source # enqueueAll :: [a] -> RewindQueue a -> RewindQueue a Source #  | |