fsprojects/FSharpx.Collections


Queue<'T>

Namespace: FSharpx.Collections

Queue is an ordered linear data structure where elements are added at the end (right) and inspected and removed at the beginning (left). Ordering is by insertion history. The qualities of the Queue structure make elements first in, first out (fifo). "head" inspects the first or left-most element in the structure, while "conj" inserts an element at the end, or right of the structure. Purely functional (immutable) Queue based on Okasaki's batched queue.

Instance members

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

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

Head
Signature: 'T

O(1). Returns the first element. (Peek)

CompiledName: get_Head

IsEmpty
Signature: bool

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

CompiledName: get_IsEmpty

Length
Signature: int

O(1). Returns the count of elememts.

CompiledName: get_Length

Rev()
Signature: unit -> Queue<'T>

O(n). Returns queue reversed.

Tail
Signature: Queue<'T>

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

CompiledName: get_Tail

TryHead
Signature: 'T option

O(1). Returns option first element

CompiledName: get_TryHead

TryTail
Signature: Queue<'T> option

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

CompiledName: get_TryTail

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

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

CompiledName: get_TryUncons

Uncons
Signature: 'T * Queue<'T>

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

CompiledName: get_Uncons

Fork me on GitHub