FSharpx.Collections


RealTimeQueue Module

RealTime queue from Chris Okasaki's "Purely functional data structures" original implementation taken from http://lepensemoi.free.fr/index.php/2010/01/07/real-time-queue

Functions and values

Function or value Description

RealTimeQueue.empty

Full Usage: RealTimeQueue.empty

Returns: RealTimeQueue<'T>

O(1). Returns queue of no elements.

Returns: RealTimeQueue<'T>

RealTimeQueue.exec queue

Full Usage: RealTimeQueue.exec queue

Parameters:
Returns: RealTimeQueue<'a>
queue : RealTimeQueue<'a>
Returns: RealTimeQueue<'a>

RealTimeQueue.head queue

Full Usage: RealTimeQueue.head queue

Parameters:
Returns: 'a

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

queue : RealTimeQueue<'a>
Returns: 'a

RealTimeQueue.isEmpty queue

Full Usage: RealTimeQueue.isEmpty queue

Parameters:
Returns: bool

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

queue : RealTimeQueue<'a>
Returns: bool

RealTimeQueue.rotate queue

Full Usage: RealTimeQueue.rotate queue

Parameters:
Returns: LazyList<'a>
queue : RealTimeQueue<'a>
Returns: LazyList<'a>

RealTimeQueue.snoc x queue

Full Usage: RealTimeQueue.snoc x queue

Parameters:
Returns: RealTimeQueue<'a>

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

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

RealTimeQueue.tail queue

Full Usage: RealTimeQueue.tail queue

Parameters:
Returns: RealTimeQueue<'a>

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

queue : RealTimeQueue<'a>
Returns: RealTimeQueue<'a>

RealTimeQueue.tryGetHead queue

Full Usage: RealTimeQueue.tryGetHead queue

Parameters:
Returns: 'a option

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

queue : RealTimeQueue<'a>
Returns: 'a option

RealTimeQueue.tryGetTail queue

Full Usage: RealTimeQueue.tryGetTail queue

Parameters:
Returns: RealTimeQueue<'a> option

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

queue : RealTimeQueue<'a>
Returns: RealTimeQueue<'a> option