fsprojects/FSharpx.Collections


PersistentVector

Namespace: FSharpx.Collections

Defines functions which allow to access and manipulate PersistentVectors.

Functions and values

Function or valueDescription
append arg1 arg2
Signature: PersistentVector<'T> -> PersistentVector<'T> -> PersistentVector<'T>
Type parameters: 'T

O(n). Returns a new vector with the elements of the second vector added at the end.

conj arg1 arg2
Signature: 'T -> PersistentVector<'T> -> PersistentVector<'T>
Type parameters: 'T

O(1). Returns a new vector with the element added at the end.

empty
Signature: PersistentVector<'T>
Type parameters: 'T

O(1). Returns vector of no elements.

flatten arg1
Signature: PersistentVector<PersistentVector<'T>> -> seq<'T>
Type parameters: 'T

O(m,n). Returns a seq from a vector of vectors.

fold arg1 arg2 arg3
Signature: ('State -> 'T -> 'State) -> 'State -> PersistentVector<'T> -> 'State
Type parameters: 'State, 'T

O(n). Returns a state from the supplied state and a function operating from left to right.

foldBack arg1 arg2 arg3
Signature: ('T -> 'State -> 'State) -> PersistentVector<'T> -> 'State -> 'State
Type parameters: 'T, 'State

O(n). Returns a state from the supplied state and a function operating from right to left.

init arg1 arg2
Signature: int -> (int -> 'T) -> PersistentVector<'T>
Type parameters: 'T

O(n). Returns a vector of the supplied length using the supplied function operating on the index.

initial arg1
Signature: PersistentVector<'T> -> PersistentVector<'T>
Type parameters: 'T

O(1) for all practical purposes; really O(log32n). Returns a new vector without the last item. If the collection is empty it throws an exception.

isEmpty arg1
Signature: PersistentVector<'T> -> bool
Type parameters: 'T

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

last arg1
Signature: PersistentVector<'T> -> 'T
Type parameters: 'T

O(1). Returns the last element in the vector. If the vector is empty it throws an exception.

length arg1
Signature: PersistentVector<'T> -> int
Type parameters: 'T

O(1). Returns the number of items in the vector.

map arg1 arg2
Signature: ('T -> 'T1) -> PersistentVector<'T> -> PersistentVector<'T1>
Type parameters: 'T, 'T1

O(n). Returns a vector whose elements are the results of applying the supplied function to each of the elements of a supplied vector.

nth arg1 arg2
Signature: int -> PersistentVector<'T> -> 'T
Type parameters: 'T

O(1) for all practical purposes; really O(log32n). Returns the value at the index. If the index is out of bounds it throws an exception.

nthNth arg1 arg2 arg3
Signature: int -> int -> PersistentVector<PersistentVector<'T>> -> 'T
Type parameters: 'T

O(log32(m,n)). Returns the value at the outer index, inner index. If either index is out of bounds it throws an exception.

ofSeq arg1
Signature: seq<'T> -> PersistentVector<'T>
Type parameters: 'T

O(n). Returns a vector of the seq.

rev arg1
Signature: PersistentVector<'T> -> PersistentVector<'T>
Type parameters: 'T

O(n). Returns vector reversed.

singleton arg1
Signature: 'T -> PersistentVector<'T>
Type parameters: 'T

O(1). Returns a new vector of one element.

toSeq arg1
Signature: PersistentVector<'T> -> seq<'T>
Type parameters: 'T

O(n). Views the given vector as a sequence.

tryInitial arg1
Signature: PersistentVector<'T> -> PersistentVector<'T> option
Type parameters: 'T

O(1) for all practical purposes; really O(log32n). Returns option vector without the last item.

tryLast arg1
Signature: PersistentVector<'T> -> 'T option
Type parameters: 'T

O(1). Returns option last element in the vector.

tryNth arg1 arg2
Signature: int -> PersistentVector<'T> -> 'T option
Type parameters: 'T

O(1) for all practical purposes; really O(log32n). Returns option value at the index.

tryNthNth arg1 arg2 arg3
Signature: int -> int -> PersistentVector<PersistentVector<'T>> -> 'T option
Type parameters: 'T

O(log32(m,n)). Returns option value at the indices.

tryUnconj arg1
Signature: PersistentVector<'T> -> (PersistentVector<'T> * 'T) option
Type parameters: 'T

O(1) for all practical purposes; really O(log32n). Returns option tuple last element and vector without last item

tryUpdate arg1 arg2 arg3
Signature: int -> 'T -> PersistentVector<'T> -> PersistentVector<'T> option
Type parameters: 'T

O(1) for all practical purposes; really O(log32n). Returns option vector that contains the given value at the index.

tryUpdateNth arg1 arg2 arg3 arg4
Signature: int -> int -> 'T -> PersistentVector<PersistentVector<'T>> -> PersistentVector<PersistentVector<'T>> option
Type parameters: 'T

O(log32(m,n)). Returns option vector that contains the given value at the indices.

unconj arg1
Signature: PersistentVector<'T> -> PersistentVector<'T> * 'T
Type parameters: 'T

O(1) for all practical purposes; really O(log32n). Returns tuple last element and vector without last item

update arg1 arg2 arg3
Signature: int -> 'T -> PersistentVector<'T> -> PersistentVector<'T>
Type parameters: 'T

O(1) for all practical purposes; really O(log32n). Returns a new vector that contains the given value at the index.

updateNth arg1 arg2 arg3 arg4
Signature: int -> int -> 'T -> PersistentVector<PersistentVector<'T>> -> PersistentVector<PersistentVector<'T>>
Type parameters: 'T

O(log32(m,n)). Returns a new vector of vectors that contains the given value at the indices.

windowSeq arg1 arg2
Signature: int -> seq<'T> -> PersistentVector<PersistentVector<'T>>
Type parameters: 'T

O(n). Returns a vector of vectors of given length from the seq. Result may be a jagged vector.

Active patterns

Active patternDescription
( |Conj|Nil| ) arg1
Signature: PersistentVector<'T> -> Choice<(PersistentVector<'T> * 'T),unit>
Type parameters: 'T

CompiledName: |Conj|Nil|

Fork me on GitHub