fsprojects/FSharpx.Collections


Deque<'T>

Namespace: FSharpx.Collections

Double-ended queue is an ordered linear linear structure implementing the signature of List (head, tail, cons) as well as the mirror-image Vector signature (last, initial, conj). "head" inspects the first or left-most element in the structure, while "last" inspects the last or right-most element. "rev" (reverse) has time complexity O(1). Ordering is by insertion history.

Instance members

Instance memberDescription
Conj(arg1)
Signature: 'T -> Deque<'T>

O(1). Returns a new deque with the element added to the end.

Cons(arg1)
Signature: 'T -> Deque<'T>

O(1). Returns a new deque with the element added to the beginning.

Head
Signature: 'T

O(1) amortized, O(n), worst case. Returns the first element.

CompiledName: get_Head

Initial
Signature: Deque<'T>

O(1) amortized, O(n), worst case. Returns a new deque of the elements before the last element.

CompiledName: get_Initial

IsEmpty
Signature: bool

O(1). Returns true if the deque has no elements.

CompiledName: get_IsEmpty

Last
Signature: 'T

O(1) amortized, O(n), worst case. Returns the last element.

CompiledName: get_Last

Length
Signature: int

O(1). Returns the count of elememts.

CompiledName: get_Length

Rev
Signature: Deque<'T>

O(1). Returns deque reversed.

CompiledName: get_Rev

Tail
Signature: Deque<'T>

O(1) amortized, O(n), worst case. Returns a new deque of the elements trailing the first element.

CompiledName: get_Tail

TryHead
Signature: 'T option

O(1) amortized, O(n), worst case. Returns option first element.

CompiledName: get_TryHead

TryInitial
Signature: Deque<'T> option

O(1) amortized, O(n), worst case. Returns a new deque of the elements before the last element.

CompiledName: get_TryInitial

TryLast
Signature: 'T option

O(1) amortized, O(n), worst case. Returns option last element.

CompiledName: get_TryLast

TryTail
Signature: Deque<'T> option

O(1) amortized, O(n), worst case. Returns option deque of the elements trailing the first element.

CompiledName: get_TryTail

TryUnconj
Signature: (Deque<'T> * 'T) option

O(1) amortized, O(n), worst case. Returns option init and the last element.

CompiledName: get_TryUnconj

TryUncons
Signature: ('T * Deque<'T>) option

O(1) amortized, O(n), worst case. Returns option first element and tail.

CompiledName: get_TryUncons

Unconj
Signature: Deque<'T> * 'T

O(1) amortized, O(n), worst case. Returns init and the last element.

CompiledName: get_Unconj

Uncons
Signature: 'T * Deque<'T>

O(1) amortized, O(n), worst case. Returns the first element and tail.

CompiledName: get_Uncons

Fork me on GitHub