fsprojects/FSharpx.Collections


Deque<'T>

Namespace: FSharpx.Collections.Experimental

Constructors

ConstructorDescription
new(front, rBack)
Signature: (front:'T list * rBack:'T list) -> Deque<'T>

CompiledName: .ctor

Instance members

Instance memberDescription
Cons(x)
Signature: x:'T -> Deque<'T>

O(1) amortized, O(n), worst case. 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

Init
Signature: Deque<'T>

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

CompiledName: get_Init

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

Lookup(i)
Signature: i:int -> 'T

O(n), worst case. Returns element by index.

Remove(i)
Signature: i:int -> Deque<'T>

O(n), worst case. Returns deque with element removed by index.

Rev
Signature: Deque<'T>

O(1). Returns deque reversed.

CompiledName: get_Rev

Snoc(x)
Signature: x:'T -> Deque<'T>

O(1) amortized, O(n), worst case. Returns a new deque with the element added to the end.

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

TryGetHead
Signature: 'T option

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

CompiledName: get_TryGetHead

TryGetInit
Signature: Deque<'T> option

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

CompiledName: get_TryGetInit

TryGetLast
Signature: 'T option

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

CompiledName: get_TryGetLast

TryGetTail
Signature: Deque<'T> option

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

CompiledName: get_TryGetTail

TryLookup(i)
Signature: i:int -> 'T option

O(n), worst case. Returns option element by index.

TryRemove(i)
Signature: i:int -> Deque<'T> option

O(n), worst case. Returns option deque with element removed by index.

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

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

CompiledName: get_TryUncons

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

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

CompiledName: get_TryUnsnoc

TryUpdate(i y)
Signature: i:int -> y:'T -> Deque<'T> option

O(n), worst case. Returns option deque with element updated by index.

Uncons
Signature: 'T * Deque<'T>

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

CompiledName: get_Uncons

Unsnoc
Signature: Deque<'T> * 'T

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

CompiledName: get_Unsnoc

Update(i y)
Signature: i:int -> y:'T -> Deque<'T>

O(n), worst case. Returns deque with element updated by index.

Fork me on GitHub