-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Double-ended queues
--   
--   Strict and lazy implementations of Double-Ended Queue (aka Dequeue or
--   Deque) based on head-tail linked list.
@package deque
@version 0.4.4

-- | Definitions of strict Deque.
--   
--   The typical toList and fromList conversions are provided
--   by means of the Foldable and IsList instances.
module Deque.Strict

-- | Strict double-ended queue (aka Dequeue or Deque) based on head-tail
--   linked list.
data Deque a

-- | Convert lazy deque to strict deque.
fromLazy :: Deque a -> Deque a

-- | Convert strict deque to lazy deque.
toLazy :: Deque a -> Deque a

-- | <math>. Construct from cons and snoc lists.
fromConsAndSnocLists :: [a] -> [a] -> Deque a

-- | <math>. Add element in the beginning.
cons :: a -> Deque a -> Deque a

-- | <math>. Add element in the ending.
snoc :: a -> Deque a -> Deque a

-- | <math>. Reverse the deque.
reverse :: Deque a -> Deque a

-- | <math>, occasionally <math>. Move the first element to the
--   end.
--   
--   
--   λ toList . shiftLeft $ fromList [1,2,3]
--   [2,3,1]
--   
shiftLeft :: Deque a -> Deque a

-- | <math>, occasionally <math>. Move the last element to the
--   beginning.
--   
--   
--   λ toList . shiftRight $ fromList [1,2,3]
--   [3,1,2]
--   
shiftRight :: Deque a -> Deque a

-- | <math>. Leave only the elements satisfying the predicate.
filter :: (a -> Bool) -> Deque a -> Deque a

-- | <math>. Leave only the specified amount of first elements.
take :: Int -> Deque a -> Deque a

-- | <math>. Drop the specified amount of first elements.
drop :: Int -> Deque a -> Deque a

-- | <math>. Leave only the first elements satisfying the predicate.
takeWhile :: (a -> Bool) -> Deque a -> Deque a

-- | <math>. Drop the first elements satisfying the predicate.
dropWhile :: (a -> Bool) -> Deque a -> Deque a

-- | <math>. Perform takeWhile and dropWhile in a
--   single operation.
span :: (a -> Bool) -> Deque a -> (Deque a, Deque a)

-- | <math>, occasionally <math>. Get the first element and
--   deque without it if it's not empty.
uncons :: Deque a -> Maybe (a, Deque a)

-- | <math>, occasionally <math>. Get the last element and
--   deque without it if it's not empty.
unsnoc :: Deque a -> Maybe (a, Deque a)

-- | <math>. Check whether deque is empty.
null :: Deque a -> Bool

-- | <math>, occasionally <math>. Get the first element if
--   deque is not empty.
head :: Deque a -> Maybe a

-- | <math>, occasionally <math>. Get the last element if deque
--   is not empty.
last :: Deque a -> Maybe a

-- | <math>, occasionally <math>. Keep all elements but the
--   first one.
--   
--   In case of empty deque returns an empty deque.
tail :: Deque a -> Deque a

-- | <math>, occasionally <math>. Keep all elements but the
--   last one.
--   
--   In case of empty deque returns an empty deque.
init :: Deque a -> Deque a

-- | Definitions of lazy Deque.
--   
--   The typical toList and fromList conversions are provided
--   by means of the Foldable and IsList instances.
module Deque.Lazy

-- | Lazy double-ended queue (aka Dequeue or Deque) based on head-tail
--   linked list.
data Deque a

-- | Convert strict deque to lazy deque.
fromStrict :: Deque a -> Deque a

-- | Convert lazy deque to strict deque.
toStrict :: Deque a -> Deque a

-- | <math>. Construct from cons and snoc lists.
fromConsAndSnocLists :: [a] -> [a] -> Deque a

-- | <math>. Add element in the beginning.
cons :: a -> Deque a -> Deque a

-- | <math>. Add element in the ending.
snoc :: a -> Deque a -> Deque a

-- | <math>. Reverse the deque.
reverse :: Deque a -> Deque a

-- | <math>, occasionally <math>. Move the first element to the
--   end.
--   
--   
--   λ toList . shiftLeft $ fromList [1,2,3]
--   [2,3,1]
--   
shiftLeft :: Deque a -> Deque a

-- | <math>, occasionally <math>. Move the last element to the
--   beginning.
--   
--   
--   λ toList . shiftRight $ fromList [1,2,3]
--   [3,1,2]
--   
shiftRight :: Deque a -> Deque a

-- | <math>. Leave only the elements satisfying the predicate.
filter :: (a -> Bool) -> Deque a -> Deque a

-- | <math>. Leave only the specified amount of first elements.
take :: Int -> Deque a -> Deque a

-- | <math>. Drop the specified amount of first elements.
drop :: Int -> Deque a -> Deque a

-- | <math>. Leave only the first elements satisfying the predicate.
takeWhile :: (a -> Bool) -> Deque a -> Deque a

-- | <math>. Drop the first elements satisfying the predicate.
dropWhile :: (a -> Bool) -> Deque a -> Deque a

-- | <math>. Perform takeWhile and dropWhile in a
--   single operation.
span :: (a -> Bool) -> Deque a -> (Deque a, Deque a)

-- | <math>, occasionally <math>. Get the first element and
--   deque without it if it's not empty.
uncons :: Deque a -> Maybe (a, Deque a)

-- | <math>, occasionally <math>. Get the last element and
--   deque without it if it's not empty.
unsnoc :: Deque a -> Maybe (a, Deque a)

-- | <math>. Check whether deque is empty.
null :: Deque a -> Bool

-- | <math>, occasionally <math>. Get the first element if
--   deque is not empty.
head :: Deque a -> Maybe a

-- | <math>, occasionally <math>. Get the last element if deque
--   is not empty.
last :: Deque a -> Maybe a

-- | <math>, occasionally <math>. Keep all elements but the
--   first one.
--   
--   In case of empty deque returns an empty deque.
tail :: Deque a -> Deque a

-- | <math>, occasionally <math>. Keep all elements but the
--   last one.
--   
--   In case of empty deque returns an empty deque.
init :: Deque a -> Deque a

-- | Lazy Deque API lifted to a State monad, "mtl"-style.
module Deque.Lazy.State

-- | <math>. Modify each element of the queue.
map :: MonadState (Deque a) m => (a -> a) -> m ()

-- | <math>. Add elements to the begginning.
prepend :: MonadState (Deque a) m => Deque a -> m ()

-- | <math>. Add elements to the ending.
append :: MonadState (Deque a) m => Deque a -> m ()

-- | <math>. Add element in the beginning.
cons :: MonadState (Deque a) m => a -> m ()

-- | <math>. Add element in the ending.
snoc :: MonadState (Deque a) m => a -> m ()

-- | <math>. Reverse the deque.
reverse :: MonadState (Deque a) m => m ()

-- | <math>, occasionally <math>. Move the first element to the
--   end.
shiftLeft :: MonadState (Deque a) m => m ()

-- | <math>, occasionally <math>. Move the last element to the
--   beginning.
shiftRight :: MonadState (Deque a) m => m ()

-- | <math>. Leave only the elements satisfying the predicate.
filter :: MonadState (Deque a) m => (a -> Bool) -> m ()

-- | <math>. Leave only the specified amount of first elements.
take :: MonadState (Deque a) m => Int -> m ()

-- | <math>. Drop the specified amount of first elements.
drop :: MonadState (Deque a) m => Int -> m ()

-- | <math>. Leave only the first elements satisfying the predicate.
takeWhile :: MonadState (Deque a) m => (a -> Bool) -> m ()

-- | <math>. Drop the first elements satisfying the predicate.
dropWhile :: MonadState (Deque a) m => (a -> Bool) -> m ()

-- | <math>. Return the first elements satisfying the predicate,
--   removing them from the state.
span :: MonadState (Deque a) m => (a -> Bool) -> m (Deque a)

-- | <math>, occasionally <math>. Get the first element if
--   deque is not empty, removing the element.
uncons :: MonadState (Deque a) m => m (Maybe a)

-- | <math>, occasionally <math>. Get the last element if deque
--   is not empty, removing the element.
unsnoc :: MonadState (Deque a) m => m (Maybe a)

-- | <math>. Check whether deque is empty.
null :: MonadState (Deque a) m => m Bool

-- | <math>. Check whether deque is empty.
length :: MonadState (Deque a) m => m Int

-- | <math>, occasionally <math>. Get the first element if
--   deque is not empty.
head :: MonadState (Deque a) m => m (Maybe a)

-- | <math>, occasionally <math>. Get the last element if deque
--   is not empty.
last :: MonadState (Deque a) m => m (Maybe a)

-- | <math>, occasionally <math>. Keep all elements but the
--   first one.
tail :: MonadState (Deque a) m => m ()

-- | <math>, occasionally <math>. Keep all elements but the
--   last one.
init :: MonadState (Deque a) m => m ()

-- | Lazy Deque API lifted to a Reader monad, "mtl"-style.
module Deque.Lazy.Reader

-- | <math>. Modify each element of the queue.
map :: MonadReader (Deque a) m => (a -> b) -> m (Deque b)

-- | <math>. Add elements to the begginning.
prepend :: MonadReader (Deque a) m => Deque a -> m (Deque a)

-- | <math>. Add elements to the ending.
append :: MonadReader (Deque a) m => Deque a -> m (Deque a)

-- | <math>. Add element in the beginning.
cons :: MonadReader (Deque a) m => a -> m (Deque a)

-- | <math>. Add element in the ending.
snoc :: MonadReader (Deque a) m => a -> m (Deque a)

-- | <math>. Reverse the deque.
reverse :: MonadReader (Deque a) m => m (Deque a)

-- | <math>, occasionally <math>. Move the first element to the
--   end.
shiftLeft :: MonadReader (Deque a) m => m (Deque a)

-- | <math>, occasionally <math>. Move the last element to the
--   beginning.
shiftRight :: MonadReader (Deque a) m => m (Deque a)

-- | <math>. Leave only the elements satisfying the predicate.
filter :: MonadReader (Deque a) m => (a -> Bool) -> m (Deque a)

-- | <math>. Leave only the specified amount of first elements.
take :: MonadReader (Deque a) m => Int -> m (Deque a)

-- | <math>. Drop the specified amount of first elements.
drop :: MonadReader (Deque a) m => Int -> m (Deque a)

-- | <math>. Leave only the first elements satisfying the predicate.
takeWhile :: MonadReader (Deque a) m => (a -> Bool) -> m (Deque a)

-- | <math>. Drop the first elements satisfying the predicate.
dropWhile :: MonadReader (Deque a) m => (a -> Bool) -> m (Deque a)

-- | <math>. Same as (,) <$> takeWhile
--   predicate <*> dropWhile predicate.
span :: MonadReader (Deque a) m => (a -> Bool) -> m (Deque a, Deque a)

-- | <math>, occasionally <math>. Get the first element and
--   deque without it if it's not empty.
uncons :: MonadReader (Deque a) m => m (Maybe a, Deque a)

-- | <math>, occasionally <math>. Get the last element and
--   deque without it if it's not empty.
unsnoc :: MonadReader (Deque a) m => m (Maybe a, Deque a)

-- | <math>. Check whether deque is empty.
null :: MonadReader (Deque a) m => m Bool

-- | <math>. Check whether deque is empty.
length :: MonadReader (Deque a) m => m Int

-- | <math>, occasionally <math>. Get the first element if
--   deque is not empty.
head :: MonadReader (Deque a) m => m (Maybe a)

-- | <math>, occasionally <math>. Get the last element if deque
--   is not empty.
last :: MonadReader (Deque a) m => m (Maybe a)

-- | <math>, occasionally <math>. Keep all elements but the
--   first one.
tail :: MonadReader (Deque a) m => m (Deque a)

-- | <math>, occasionally <math>. Keep all elements but the
--   last one.
init :: MonadReader (Deque a) m => m (Deque a)

-- | Strict Deque API lifted to a Reader monad, "mtl"-style.
module Deque.Strict.Reader

-- | <math>. Modify each element of the queue.
map :: MonadReader (Deque a) m => (a -> b) -> m (Deque b)

-- | <math>. Add elements to the begginning.
prepend :: MonadReader (Deque a) m => Deque a -> m (Deque a)

-- | <math>. Add elements to the ending.
append :: MonadReader (Deque a) m => Deque a -> m (Deque a)

-- | <math>. Add element in the beginning.
cons :: MonadReader (Deque a) m => a -> m (Deque a)

-- | <math>. Add element in the ending.
snoc :: MonadReader (Deque a) m => a -> m (Deque a)

-- | <math>. Reverse the deque.
reverse :: MonadReader (Deque a) m => m (Deque a)

-- | <math>, occasionally <math>. Move the first element to the
--   end.
shiftLeft :: MonadReader (Deque a) m => m (Deque a)

-- | <math>, occasionally <math>. Move the last element to the
--   beginning.
shiftRight :: MonadReader (Deque a) m => m (Deque a)

-- | <math>. Leave only the elements satisfying the predicate.
filter :: MonadReader (Deque a) m => (a -> Bool) -> m (Deque a)

-- | <math>. Leave only the specified amount of first elements.
take :: MonadReader (Deque a) m => Int -> m (Deque a)

-- | <math>. Drop the specified amount of first elements.
drop :: MonadReader (Deque a) m => Int -> m (Deque a)

-- | <math>. Leave only the first elements satisfying the predicate.
takeWhile :: MonadReader (Deque a) m => (a -> Bool) -> m (Deque a)

-- | <math>. Drop the first elements satisfying the predicate.
dropWhile :: MonadReader (Deque a) m => (a -> Bool) -> m (Deque a)

-- | <math>. Same as (,) <$> takeWhile
--   predicate <*> dropWhile predicate.
span :: MonadReader (Deque a) m => (a -> Bool) -> m (Deque a, Deque a)

-- | <math>, occasionally <math>. Get the first element and
--   deque without it if it's not empty.
uncons :: MonadReader (Deque a) m => m (Maybe a, Deque a)

-- | <math>, occasionally <math>. Get the last element and
--   deque without it if it's not empty.
unsnoc :: MonadReader (Deque a) m => m (Maybe a, Deque a)

-- | <math>. Check whether deque is empty.
null :: MonadReader (Deque a) m => m Bool

-- | <math>. Check whether deque is empty.
length :: MonadReader (Deque a) m => m Int

-- | <math>, occasionally <math>. Get the first element if
--   deque is not empty.
head :: MonadReader (Deque a) m => m (Maybe a)

-- | <math>, occasionally <math>. Get the last element if deque
--   is not empty.
last :: MonadReader (Deque a) m => m (Maybe a)

-- | <math>, occasionally <math>. Keep all elements but the
--   first one.
tail :: MonadReader (Deque a) m => m (Deque a)

-- | <math>, occasionally <math>. Keep all elements but the
--   last one.
init :: MonadReader (Deque a) m => m (Deque a)

-- | Strict Deque API lifted to a State monad, "mtl"-style.
module Deque.Strict.State

-- | <math>. Modify each element of the queue.
map :: MonadState (Deque a) m => (a -> a) -> m ()

-- | <math>. Add elements to the begginning.
prepend :: MonadState (Deque a) m => Deque a -> m ()

-- | <math>. Add elements to the ending.
append :: MonadState (Deque a) m => Deque a -> m ()

-- | <math>. Add element in the beginning.
cons :: MonadState (Deque a) m => a -> m ()

-- | <math>. Add element in the ending.
snoc :: MonadState (Deque a) m => a -> m ()

-- | <math>. Reverse the deque.
reverse :: MonadState (Deque a) m => m ()

-- | <math>, occasionally <math>. Move the first element to the
--   end.
shiftLeft :: MonadState (Deque a) m => m ()

-- | <math>, occasionally <math>. Move the last element to the
--   beginning.
shiftRight :: MonadState (Deque a) m => m ()

-- | <math>. Leave only the elements satisfying the predicate.
filter :: MonadState (Deque a) m => (a -> Bool) -> m ()

-- | <math>. Leave only the specified amount of first elements.
take :: MonadState (Deque a) m => Int -> m ()

-- | <math>. Drop the specified amount of first elements.
drop :: MonadState (Deque a) m => Int -> m ()

-- | <math>. Leave only the first elements satisfying the predicate.
takeWhile :: MonadState (Deque a) m => (a -> Bool) -> m ()

-- | <math>. Drop the first elements satisfying the predicate.
dropWhile :: MonadState (Deque a) m => (a -> Bool) -> m ()

-- | <math>. Return the first elements satisfying the predicate,
--   removing them from the state.
span :: MonadState (Deque a) m => (a -> Bool) -> m (Deque a)

-- | <math>, occasionally <math>. Get the first element if
--   deque is not empty, removing the element.
uncons :: MonadState (Deque a) m => m (Maybe a)

-- | <math>, occasionally <math>. Get the last element if deque
--   is not empty, removing the element.
unsnoc :: MonadState (Deque a) m => m (Maybe a)

-- | <math>. Check whether deque is empty.
null :: MonadState (Deque a) m => m Bool

-- | <math>. Check whether deque is empty.
length :: MonadState (Deque a) m => m Int

-- | <math>, occasionally <math>. Get the first element if
--   deque is not empty.
head :: MonadState (Deque a) m => m (Maybe a)

-- | <math>, occasionally <math>. Get the last element if deque
--   is not empty.
last :: MonadState (Deque a) m => m (Maybe a)

-- | <math>, occasionally <math>. Keep all elements but the
--   first one.
tail :: MonadState (Deque a) m => m ()

-- | <math>, occasionally <math>. Keep all elements but the
--   last one.
init :: MonadState (Deque a) m => m ()
