FSharpx.Collections


Deque Module

Functions and values

Function or value Description

Deque.cons x q

Full Usage: Deque.cons x q

Parameters:
Returns: Deque<'T>

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

x : 'T
q : Deque<'T>
Returns: Deque<'T>

Deque.empty ()

Full Usage: Deque.empty ()

Parameters:
    () : unit

Returns: Deque<'a>

O(1). Returns deque of no elements.

() : unit
Returns: Deque<'a>

Deque.head q

Full Usage: Deque.head q

Parameters:
Returns: 'T

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

q : Deque<'T>
Returns: 'T

Deque.init q

Full Usage: Deque.init q

Parameters:
Returns: Deque<'T>

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

q : Deque<'T>
Returns: Deque<'T>

Deque.isEmpty q

Full Usage: Deque.isEmpty q

Parameters:
Returns: bool

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

q : Deque<'T>
Returns: bool

Deque.last q

Full Usage: Deque.last q

Parameters:
Returns: 'T

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

q : Deque<'T>
Returns: 'T

Deque.length q

Full Usage: Deque.length q

Parameters:
Returns: int

O(1). Returns the count of elements.

q : Deque<'T>
Returns: int

Deque.lookup i q

Full Usage: Deque.lookup i q

Parameters:
Returns: 'T

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

i : int
q : Deque<'T>
Returns: 'T

Deque.ofCatLists xs ys

Full Usage: Deque.ofCatLists xs ys

Parameters:
    xs : 'a list
    ys : 'a list

Returns: Deque<'a>

O(ys). Returns a deque of the two lists concatenated.

xs : 'a list
ys : 'a list
Returns: Deque<'a>

Deque.ofSeq xs

Full Usage: Deque.ofSeq xs

Parameters:
    xs : seq<'a>

Returns: Deque<'a>

O(n/2). Returns a deque of the seq.

xs : seq<'a>
Returns: Deque<'a>

Deque.remove i q

Full Usage: Deque.remove i q

Parameters:
Returns: Deque<'T>

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

i : int
q : Deque<'T>
Returns: Deque<'T>

Deque.rev q

Full Usage: Deque.rev q

Parameters:
Returns: Deque<'T>

O(1). Returns deque reversed.

q : Deque<'T>
Returns: Deque<'T>

Deque.singleton x

Full Usage: Deque.singleton x

Parameters:
    x : 'a

Returns: Deque<'a>

O(1). Returns a deque of one element.

x : 'a
Returns: Deque<'a>

Deque.snoc x q

Full Usage: Deque.snoc x q

Parameters:
Returns: Deque<'T>

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

x : 'T
q : Deque<'T>
Returns: Deque<'T>

Deque.tail q

Full Usage: Deque.tail q

Parameters:
Returns: Deque<'T>

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

q : Deque<'T>
Returns: Deque<'T>

Deque.tryGetHead q

Full Usage: Deque.tryGetHead q

Parameters:
Returns: 'T option

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

q : Deque<'T>
Returns: 'T option

Deque.tryGetInit q

Full Usage: Deque.tryGetInit q

Parameters:
Returns: Deque<'T> option

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

q : Deque<'T>
Returns: Deque<'T> option

Deque.tryGetLast q

Full Usage: Deque.tryGetLast q

Parameters:
Returns: 'T option

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

q : Deque<'T>
Returns: 'T option

Deque.tryGetTail q

Full Usage: Deque.tryGetTail q

Parameters:
Returns: Deque<'T> option

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

q : Deque<'T>
Returns: Deque<'T> option

Deque.tryLookup i q

Full Usage: Deque.tryLookup i q

Parameters:
Returns: 'T option

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

i : int
q : Deque<'T>
Returns: 'T option

Deque.tryRemove i q

Full Usage: Deque.tryRemove i q

Parameters:
Returns: Deque<'T> option

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

i : int
q : Deque<'T>
Returns: Deque<'T> option

Deque.tryUncons q

Full Usage: Deque.tryUncons q

Parameters:
Returns: ('T * Deque<'T>) option

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

q : Deque<'T>
Returns: ('T * Deque<'T>) option

Deque.tryUnsnoc q

Full Usage: Deque.tryUnsnoc q

Parameters:
Returns: (Deque<'T> * 'T) option

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

q : Deque<'T>
Returns: (Deque<'T> * 'T) option

Deque.tryUpdate i y q

Full Usage: Deque.tryUpdate i y q

Parameters:
    i : int
    y : 'T
    q : Deque<'T>

Returns: Deque<'T> option

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

i : int
y : 'T
q : Deque<'T>
Returns: Deque<'T> option

Deque.uncons q

Full Usage: Deque.uncons q

Parameters:
Returns: 'T * Deque<'T>

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

q : Deque<'T>
Returns: 'T * Deque<'T>

Deque.unsnoc q

Full Usage: Deque.unsnoc q

Parameters:
Returns: Deque<'T> * 'T

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

q : Deque<'T>
Returns: Deque<'T> * 'T

Deque.update i y q

Full Usage: Deque.update i y q

Parameters:
    i : int
    y : 'T
    q : Deque<'T>

Returns: Deque<'T>

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

i : int
y : 'T
q : Deque<'T>
Returns: Deque<'T>

Active patterns

Active pattern Description

Deque.(|Cons|Nil|) q

Full Usage: Deque.(|Cons|Nil|) q

Parameters:
Returns: Choice<('T * Deque<'T>), unit>
q : Deque<'T>
Returns: Choice<('T * Deque<'T>), unit>

Deque.(|Snoc|Nil|) q

Full Usage: Deque.(|Snoc|Nil|) q

Parameters:
Returns: Choice<(Deque<'T> * 'T), unit>
q : Deque<'T>
Returns: Choice<(Deque<'T> * 'T), unit>