lens-5.0.1: Lenses, Folds and Traversals
Copyright (C) 2012-16 Edward Kmett
License BSD-style (see the file LICENSE)
Maintainer Edward Kmett <ekmett@gmail.com>
Stability experimental
Portability non-portable
Safe Haskell Safe-Inferred
Language Haskell2010

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

Instances details
Monad Deque Source #
Instance details

Defined in Control.Lens.Internal.Deque

Functor Deque Source #
Instance details

Defined in Control.Lens.Internal.Deque

Applicative Deque Source #
Instance details

Defined in Control.Lens.Internal.Deque

Foldable Deque Source #
Instance details

Defined in Control.Lens.Internal.Deque

Traversable Deque Source #
Instance details

Defined in Control.Lens.Internal.Deque

Alternative Deque Source #
Instance details

Defined in Control.Lens.Internal.Deque

MonadPlus Deque Source #
Instance details

Defined in Control.Lens.Internal.Deque

Plus Deque Source #
Instance details

Defined in Control.Lens.Internal.Deque

Alt Deque Source #
Instance details

Defined in Control.Lens.Internal.Deque

Apply Deque Source #
Instance details

Defined in Control.Lens.Internal.Deque

Bind Deque Source #
Instance details

Defined in Control.Lens.Internal.Deque

FunctorWithIndex Int Deque Source #
Instance details

Defined in Control.Lens.Internal.Deque

Methods

imap :: ( Int -> a -> b) -> Deque a -> Deque b Source #

FoldableWithIndex Int Deque Source #
Instance details

Defined in Control.Lens.Internal.Deque

Methods

ifoldMap :: Monoid m => ( Int -> a -> m) -> Deque a -> m Source #

ifoldMap' :: Monoid m => ( Int -> a -> m) -> Deque a -> m Source #

ifoldr :: ( Int -> a -> b -> b) -> b -> Deque a -> b Source #

ifoldl :: ( Int -> b -> a -> b) -> b -> Deque a -> b Source #

ifoldr' :: ( Int -> a -> b -> b) -> b -> Deque a -> b Source #

ifoldl' :: ( Int -> b -> a -> b) -> b -> Deque a -> b Source #

TraversableWithIndex Int Deque Source #
Instance details

Defined in Control.Lens.Internal.Deque

Methods

itraverse :: Applicative f => ( Int -> a -> f b) -> Deque a -> f ( Deque b) Source #

Eq a => Eq ( Deque a) Source #
Instance details

Defined in Control.Lens.Internal.Deque

Ord a => Ord ( Deque a) Source #
Instance details

Defined in Control.Lens.Internal.Deque

Show a => Show ( Deque a) Source #
Instance details

Defined in Control.Lens.Internal.Deque

Semigroup ( Deque a) Source #
Instance details

Defined in Control.Lens.Internal.Deque

Monoid ( Deque a) Source #
Instance details

Defined in Control.Lens.Internal.Deque

Reversing ( Deque a) Source #
Instance details

Defined in Control.Lens.Internal.Deque

Snoc ( Deque a) ( Deque b) a b Source #
Instance details

Defined in Control.Lens.Internal.Deque

Cons ( Deque a) ( Deque b) a b Source #
Instance details

Defined in Control.Lens.Internal.Deque

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 .

>>> Control.Lens.Internal.Deque.null empty
True
>>> Control.Lens.Internal.Deque.null (singleton 1)
False

singleton :: a -> Deque a Source #

O(1) . Generate a singleton Deque

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