Safe Haskell | None |
---|---|
Language | Haskell2010 |
Lazy Deque API lifted to a Reader monad, "mtl"-style.
Synopsis
- map :: MonadReader (Deque a) m => (a -> b) -> m (Deque b)
- prepend :: MonadReader (Deque a) m => Deque a -> m (Deque a)
- append :: MonadReader (Deque a) m => Deque a -> m (Deque a)
- cons :: MonadReader (Deque a) m => a -> m (Deque a)
- snoc :: MonadReader (Deque a) m => a -> m (Deque a)
- reverse :: MonadReader (Deque a) m => m (Deque a)
- shiftLeft :: MonadReader (Deque a) m => m (Deque a)
- shiftRight :: MonadReader (Deque a) m => m (Deque a)
- filter :: MonadReader (Deque a) m => (a -> Bool) -> m (Deque a)
- take :: MonadReader (Deque a) m => Int -> m (Deque a)
- drop :: MonadReader (Deque a) m => Int -> m (Deque a)
- takeWhile :: MonadReader (Deque a) m => (a -> Bool) -> m (Deque a)
- dropWhile :: MonadReader (Deque a) m => (a -> Bool) -> m (Deque a)
- uncons :: MonadReader (Deque a) m => m (Maybe a, Deque a)
- unsnoc :: MonadReader (Deque a) m => m (Maybe a, Deque a)
- null :: MonadReader (Deque a) m => m Bool
- length :: MonadReader (Deque a) m => m Int
- head :: MonadReader (Deque a) m => m (Maybe a)
- last :: MonadReader (Deque a) m => m (Maybe a)
- tail :: MonadReader (Deque a) m => m (Deque a)
- init :: MonadReader (Deque a) m => m (Deque a)
Documentation
map :: MonadReader (Deque a) m => (a -> b) -> m (Deque b) Source #
O(n). Modify each element of the queue.
prepend :: MonadReader (Deque a) m => Deque a -> m (Deque a) Source #
O(n). Add elements to the begginning.
append :: MonadReader (Deque a) m => Deque a -> m (Deque a) Source #
O(n). Add elements to the ending.
shiftLeft :: MonadReader (Deque a) m => m (Deque a) Source #
O(1), occasionally O(n). Move the first element to the end.
shiftRight :: MonadReader (Deque a) m => m (Deque a) Source #
O(1), occasionally O(n). Move the last element to the beginning.
filter :: MonadReader (Deque a) m => (a -> Bool) -> m (Deque a) Source #
O(n). Leave only the elements satisfying the predicate.
take :: MonadReader (Deque a) m => Int -> m (Deque a) Source #
O(n). Leave only the specified amount of first elements.
drop :: MonadReader (Deque a) m => Int -> m (Deque a) Source #
O(n). Drop the specified amount of first elements.
takeWhile :: MonadReader (Deque a) m => (a -> Bool) -> m (Deque a) Source #
O(n). Leave only the first elements satisfying the predicate.
dropWhile :: MonadReader (Deque a) m => (a -> Bool) -> m (Deque a) Source #
O(n). Drop the first elements satisfying the predicate.
uncons :: MonadReader (Deque a) m => m (Maybe a, Deque a) Source #
O(1), occasionally O(n). Get the first element and deque without it if it's not empty.
unsnoc :: MonadReader (Deque a) m => m (Maybe a, Deque a) Source #
O(1), occasionally O(n). Get the last element and deque without it if it's not empty.
head :: MonadReader (Deque a) m => m (Maybe a) Source #
O(1), occasionally O(n). Get the first element if deque is not empty.
last :: MonadReader (Deque a) m => m (Maybe a) Source #
O(1), occasionally O(n). Get the last element if deque is not empty.