FSharpx.Collections


ImplicitQueue Module

implicit queue from Chris Okasaki's "Purely functional data structures" original implementation taken from http://lepensemoi.free.fr/index.php/2010/02/18/implicit-queue

Functions and values

Function or value Description

ImplicitQueue.empty

Full Usage: ImplicitQueue.empty

Returns: ImplicitQueue<'a>

O(1). Returns queue of no elements.

Returns: ImplicitQueue<'a>

ImplicitQueue.head queue

Full Usage: ImplicitQueue.head queue

Parameters:
Returns: 'T

O(1), amortized. Returns the first element.

queue : ImplicitQueue<'T>
Returns: 'T

ImplicitQueue.isEmpty _arg1

Full Usage: ImplicitQueue.isEmpty _arg1

Parameters:
Returns: bool

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

_arg1 : ImplicitQueue<'a>
Returns: bool

ImplicitQueue.snoc x queue

Full Usage: ImplicitQueue.snoc x queue

Parameters:
Returns: ImplicitQueue<'a>

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

x : 'a
queue : ImplicitQueue<'a>
Returns: ImplicitQueue<'a>

ImplicitQueue.tail queue

Full Usage: ImplicitQueue.tail queue

Parameters:
Returns: ImplicitQueue<'T>

O(1), amortized. Returns a new queue of the elements trailing the first element.

queue : ImplicitQueue<'T>
Returns: ImplicitQueue<'T>

ImplicitQueue.tryGetHead queue

Full Usage: ImplicitQueue.tryGetHead queue

Parameters:
Returns: 'T option

O(1), amortized. Returns option first element.

queue : ImplicitQueue<'T>
Returns: 'T option

ImplicitQueue.tryGetTail queue

Full Usage: ImplicitQueue.tryGetTail queue

Parameters:
Returns: ImplicitQueue<'T> option

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

queue : ImplicitQueue<'T>
Returns: ImplicitQueue<'T> option