lens-4.13.1: Lenses, Folds and Traversals

Copyright(C) 2012-16 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell98

Control.Lens.Internal.Deque

Description

This module is designed to be imported qualified.

Synopsis

Documentation

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 []