System.Collections.Generic
namespace, in that the F# collection types are designed from a functional programming perspective rather than an object-oriented perspective. More specifically, only the array collection has mutable elements. Therefore, when you modify a collection, you create an instance of the modified collection instead of altering the original collection.Type | Description | Related Links |
---|---|---|
List | An ordered, immutable series of elements of the same type. Implemented as a linked list. | List Module |
Array | A fixed-size, zero-based, mutable collection of consecutive data elements that are all of the same type. | Array Module Array2D Module Array3D Module |
seq | A logical series of elements that are all of one type. Sequences are particularly useful when you have a large, ordered collection of data but don't necessarily expect to use all the elements. Individual sequence elements are computed only as required, so a sequence can perform better than a list if not all the elements are used. Sequences are represented by the seq<'T> type, which is an alias for IEnumerable . Therefore, any .NET Framework type that implements System.Collections.Generic.IEnumerable<'T> can be used as a sequence. |
Seq Module |
Map | An immutable dictionary of elements. Elements are accessed by key. | Map Module |
Set | An immutable set that's based on binary trees, where comparison is the F# structural comparison function, which potentially uses implementations of the System.IComparable interface on key values. |
Set Module |