lens-4.13.2: Lenses, Folds and Traversals

Control.Lens.Internal.Deque

Description

This module is designed to be imported qualified.

Synopsis

Documentation

data Deque a Source

A Banker's deque based on Chris Okasaki's "Purely Functional Data Structures"

Constructors

 BD !Int [a] !Int [a]

Instances

 Source Methods(>>=) :: Deque a -> (a -> Deque b) -> Deque b(>>) :: Deque a -> Deque b -> Deque breturn :: a -> Deque afail :: String -> Deque a Source Methodsfmap :: (a -> b) -> Deque a -> Deque b(<\$) :: a -> Deque b -> Deque a Source Methodspure :: a -> Deque a(<*>) :: Deque (a -> b) -> Deque a -> Deque b(*>) :: Deque a -> Deque b -> Deque b(<*) :: Deque a -> Deque b -> Deque a Source Methodsfold :: Monoid m => Deque m -> mfoldMap :: Monoid m => (a -> m) -> Deque a -> mfoldr :: (a -> b -> b) -> b -> Deque a -> bfoldr' :: (a -> b -> b) -> b -> Deque a -> bfoldl :: (b -> a -> b) -> b -> Deque a -> bfoldl' :: (b -> a -> b) -> b -> Deque a -> bfoldr1 :: (a -> a -> a) -> Deque a -> afoldl1 :: (a -> a -> a) -> Deque a -> atoList :: Deque a -> [a]null :: Deque a -> Boollength :: Deque a -> Intelem :: Eq a => a -> Deque a -> Boolmaximum :: Ord a => Deque a -> aminimum :: Ord a => Deque a -> asum :: Num a => Deque a -> aproduct :: Num a => Deque a -> a Source Methodstraverse :: Applicative f => (a -> f b) -> Deque a -> f (Deque b)sequenceA :: Applicative f => Deque (f a) -> f (Deque a)mapM :: Monad m => (a -> m b) -> Deque a -> m (Deque b)sequence :: Monad m => Deque (m a) -> m (Deque a) Source Methodsempty :: Deque a(<|>) :: Deque a -> Deque a -> Deque asome :: Deque a -> Deque [a]many :: Deque a -> Deque [a] Source Methodsmzero :: Deque amplus :: Deque a -> Deque a -> Deque a Source Methodszero :: Deque a Source Methods() :: Deque a -> Deque a -> Deque asome :: Applicative Deque => Deque a -> Deque [a]many :: Applicative Deque => Deque a -> Deque [a] Source Methods(<.>) :: Deque (a -> b) -> Deque a -> Deque b(.>) :: Deque a -> Deque b -> Deque b(<.) :: Deque a -> Deque b -> Deque a Source Methods(>>-) :: Deque a -> (a -> Deque b) -> Deque bjoin :: Deque (Deque a) -> Deque a Source Methodsitraverse :: Applicative f => (Int -> a -> f b) -> Deque a -> f (Deque b) Sourceitraversed :: (Indexable Int p, Applicative f) => p a (f b) -> Deque a -> f (Deque b) Source Source MethodsifoldMap :: Monoid m => (Int -> a -> m) -> Deque a -> m Sourceifolded :: (Indexable Int p, Contravariant f, Applicative f) => p a (f a) -> Deque a -> f (Deque a) Sourceifoldr :: (Int -> a -> b -> b) -> b -> Deque a -> b Sourceifoldl :: (Int -> b -> a -> b) -> b -> Deque a -> b Sourceifoldr' :: (Int -> a -> b -> b) -> b -> Deque a -> b Sourceifoldl' :: (Int -> b -> a -> b) -> b -> Deque a -> b Source Source Methodsimap :: (Int -> a -> b) -> Deque a -> Deque b Sourceimapped :: (Indexable Int p, Settable f) => p a (f b) -> Deque a -> f (Deque b) Source Eq a => Eq (Deque a) Source Methods(==) :: Deque a -> Deque a -> Bool(/=) :: Deque a -> Deque a -> Bool Ord a => Ord (Deque a) Source Methodscompare :: Deque a -> Deque a -> Ordering(<) :: Deque a -> Deque a -> Bool(<=) :: Deque a -> Deque a -> Bool(>) :: Deque a -> Deque a -> Bool(>=) :: Deque a -> Deque a -> Boolmax :: Deque a -> Deque a -> Deque amin :: Deque a -> Deque a -> Deque a Show a => Show (Deque a) Source MethodsshowsPrec :: Int -> Deque a -> ShowSshow :: Deque a -> StringshowList :: [Deque a] -> ShowS Monoid (Deque a) Source Methodsmempty :: Deque amappend :: Deque a -> Deque a -> Deque amconcat :: [Deque a] -> Deque a Source Methods(<>) :: Deque a -> Deque a -> Deque asconcat :: NonEmpty (Deque a) -> Deque astimes :: Integral b => b -> Deque a -> Deque a Source Methodsreversing :: Deque a -> Deque a Source Snoc (Deque a) (Deque b) a b Source Methods_Snoc :: Prism (Deque a) (Deque b) (Deque a, a) (Deque b, b) Source Cons (Deque a) (Deque b) a b Source Methods_Cons :: Prism (Deque a) (Deque b) (a, Deque a) (b, Deque b) Source

size :: Deque a -> Int Source

O(1). Calculate the size of a `Deque`

````>>> ````size (fromList [1,4,6])
```3
```

fromList :: [a] -> Deque a Source

O(n) amortized. Construct a `Deque` from a list of values.

````>>> ````fromList [1,2]
```BD 1 [1] 1 [2]
```

null :: Deque a -> Bool Source

O(1). Determine if a `Deque` is `empty`.

````>>> ````null empty
```True
```
````>>> ````null (singleton 1)
```False
```

singleton :: a -> Deque a Source

O(1). Generate a singleton `Deque`

````>>> ````singleton 1
```BD 1 [1] 0 []
```