O(n).
Modify each element of the queue.
Moduledeque-0.4.4.4Haskell2010
Deque.Strict.State
Strict Deque API lifted to a State monad, "mtl"-style.
- 22 values
- Packagedeque-0.4.4.4
- Exports22
- LanguageHaskell2010
- LicenceMIT
- SourceState.hs
O(n).
Add elements to the begginning.
O(n).
Add elements to the ending.
O(1).
Add element in the beginning.
O(1).
Add element in the ending.
O(1).
Reverse the deque.
O(1), occasionally O(n).
Move the first element to the end.
O(1), occasionally O(n).
Move the last element to the beginning.
O(n).
Leave only the elements satisfying the predicate.
O(n).
Leave only the specified amount of first elements.
O(n).
Drop the specified amount of first elements.
O(n).
Leave only the first elements satisfying the predicate.
O(n).
Drop the first elements satisfying the predicate.
O(n).
Return the first elements satisfying the predicate, removing them from the state.
O(1), occasionally O(n).
Get the first element if deque is not empty,
removing the element.
O(1), occasionally O(n).
Get the last element if deque is not empty,
removing the element.
O(1).
Check whether deque is empty.
O(1).
Check whether deque is empty.
O(1), occasionally O(n).
Get the first element if deque is not empty.
O(1), occasionally O(n).
Get the last element if deque is not empty.
O(1), occasionally O(n).
Keep all elements but the first one.
O(1), occasionally O(n).
Keep all elements but the last one.