FSharpx.Collections


FSharpx.Collections Namespace

Type/Module Description

Array

Extensions for F#'s Array module.

ByteString (Module)

ByteString (Type)

An ArraySegment with structural comparison and equality.

Deque

Deque<'T>

Double-ended queue is an ordered linear linear structure implementing the signature of List (head, tail, cons) as well as the mirror-image Vector signature (last, initial, conj). "head" inspects the first or left-most element in the structure, while "last" inspects the last or right-most element. "rev" (reverse) has time complexity O(1). Ordering is by insertion history.

Dictionary

Extensions for System.Collections.Generic.Dictionary.

DList

DList<'T>

DList is an ordered linear structure implementing the List signature (head, tail, cons), end-insertion (conj), and O(1) append. Ordering is by insertion history. DList is an implementation of [John Hughes' append list](http://dl.acm.org/citation.cfm?id=8475).

Exceptions

Heap

Heap<'T>

Heap is an ordered linear structure where the ordering is either ascending or descending. "head" inspects the first element in the ordering, "tail" takes the remaining structure after head, and "insert" places elements within the ordering. PriorityQueue is available as an alternate interface. According to Okasaki the time complexity of the heap functions in this Heap implementation (based on the "pairing" heap) have "resisted" time complexity analysis.

HeapData<'T>

Interfaces

IPriorityQueue<'T>

LazyList

LazyList<'T>

LazyLists are possibly-infinite, cached sequences. See also IEnumerable/Seq for uncached sequences. LazyLists normally involve delayed computations without side-effects. The results of these computations are cached and evaluations will be performed only once for each element of the lazy list. In contrast, for sequences (IEnumerable) recomputation happens each time an enumerator is created and the sequence traversed. LazyLists can represent cached, potentially-infinite computations. Because they are cached they may cause memory leaks if some active code or data structure maintains a live reference to the head of an infinite or very large lazy list while iterating it, or if a reference is maintained after the list is no longer required. Lazy lists may be matched using the LazyList.Cons and LazyList.Nil active patterns. These may force the computation of elements of the list.

List

Extensions for F#'s List module.

Literals

Map

Extensions for F#'s Map module.

NameValueCollection

Extensions for NameValueCollections.

NonEmptyList

NonEmptyList<'T>

PersistentHashMap

Defines functions which allow to access and manipulate PersistentHashMaps.

PersistentHashMap<'T, 'S>

A Map is a collection that maps keys to values. Hash maps require keys that correctly support GetHashCode and Equals. Hash maps provide fast access (log32N hops). count is O(1).

PersistentVector

Defines functions which allow to access and manipulate PersistentVectors.

PersistentVector<'T>

PersistentVector is an ordered linear structure implementing the inverse of the List signature, (last, initial, conj) in place of (head, tail, cons). Length is O(1). Indexed lookup or update (returning a new immutable instance of Vector) of any element is O(log32n), which is close enough to O(1) as to make no practical difference: a PersistentVector containing 4 billion items can lookup or update any item in at most 7 steps. Ordering is by insertion history. The original idea can be found in [Clojure](http://clojure.org/data_structures).

PriorityQueue

Queue

Queue<'T>

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.

RandomAccessList

Defines functions which allow to access and manipulate RandomAccessLists.

RandomAccessList<'T>

RandomAccessList is an ordered linear structure implementing the List signature (head, tail, cons), as well as inspection (lookup) and update (returning a new immutable instance) of any element in the structure by index. Length is O(1). Indexed lookup or update (returning a new immutable instance of RandomAccessList) of any element is O(log32n), which is close enough to O(1) as to make no practical difference: a RandomAccessList containing 4 billion items can lookup or update any item in at most 7 steps. Ordering is by insertion history. While PersistentVector<'T> is appending to the end this version prepends elements to the list.

ResizeArray

Generic operations on the type System.Collections.Generic.List, which is called ResizeArray in the F# libraries.

Seq

Extensions for F#'s Seq module.