FSharpx.Collections


PersistentVector Module

Defines functions which allow to access and manipulate PersistentVectors.

Functions and values

Function or value Description

PersistentVector.append arg1 arg2

Full Usage: PersistentVector.append arg1 arg2

Parameters:
Returns: PersistentVector<'T>

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

arg0 : PersistentVector<'T>
arg1 : PersistentVector<'T>
Returns: PersistentVector<'T>

PersistentVector.conj arg1 arg2

Full Usage: PersistentVector.conj arg1 arg2

Parameters:
Returns: PersistentVector<'T>

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

arg0 : 'T
arg1 : PersistentVector<'T>
Returns: PersistentVector<'T>

PersistentVector.empty

Full Usage: PersistentVector.empty

Returns: PersistentVector<'T>

O(1). Returns vector of no elements.

Returns: PersistentVector<'T>

PersistentVector.flatten arg1

Full Usage: PersistentVector.flatten arg1

Parameters:
Returns: seq<'T>

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

arg0 : PersistentVector<PersistentVector<'T>>
Returns: seq<'T>

PersistentVector.fold arg1 arg2 arg3

Full Usage: PersistentVector.fold arg1 arg2 arg3

Parameters:
Returns: 'State

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

arg0 : 'State -> 'T -> 'State
arg1 : 'State
arg2 : PersistentVector<'T>
Returns: 'State

PersistentVector.foldBack arg1 arg2 arg3

Full Usage: PersistentVector.foldBack arg1 arg2 arg3

Parameters:
Returns: 'State

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

arg0 : 'T -> 'State -> 'State
arg1 : PersistentVector<'T>
arg2 : 'State
Returns: 'State

PersistentVector.init arg1 arg2

Full Usage: PersistentVector.init arg1 arg2

Parameters:
    arg0 : int
    arg1 : int -> 'T

Returns: PersistentVector<'T>

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

arg0 : int
arg1 : int -> 'T
Returns: PersistentVector<'T>

PersistentVector.initial arg1

Full Usage: PersistentVector.initial arg1

Parameters:
Returns: PersistentVector<'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.

arg0 : PersistentVector<'T>
Returns: PersistentVector<'T>

PersistentVector.isEmpty arg1

Full Usage: PersistentVector.isEmpty arg1

Parameters:
Returns: bool

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

arg0 : PersistentVector<'T>
Returns: bool

PersistentVector.last arg1

Full Usage: PersistentVector.last arg1

Parameters:
Returns: 'T

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

arg0 : PersistentVector<'T>
Returns: 'T

PersistentVector.length arg1

Full Usage: PersistentVector.length arg1

Parameters:
Returns: int

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

arg0 : PersistentVector<'T>
Returns: int

PersistentVector.map arg1 arg2

Full Usage: PersistentVector.map arg1 arg2

Parameters:
Returns: PersistentVector<'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.

arg0 : 'T -> 'T1
arg1 : PersistentVector<'T>
Returns: PersistentVector<'T1>

PersistentVector.nth arg1 arg2

Full Usage: PersistentVector.nth arg1 arg2

Parameters:
Returns: '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.

arg0 : int
arg1 : PersistentVector<'T>
Returns: 'T

PersistentVector.nthNth arg1 arg2 arg3

Full Usage: PersistentVector.nthNth arg1 arg2 arg3

Parameters:
Returns: '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.

arg0 : int
arg1 : int
arg2 : PersistentVector<PersistentVector<'T>>
Returns: 'T

PersistentVector.ofSeq arg1

Full Usage: PersistentVector.ofSeq arg1

Parameters:
    arg0 : seq<'T>

Returns: PersistentVector<'T>

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

arg0 : seq<'T>
Returns: PersistentVector<'T>

PersistentVector.rangedIterator arg1 arg2 arg3

Full Usage: PersistentVector.rangedIterator arg1 arg2 arg3

Parameters:
Returns: seq<'T>

O(n). Views a subset of the given vector. startIndex is inclusive, endIndex is exclusive. `rangedIterator 0 count` is the same as toSeq

arg0 : int
arg1 : int
arg2 : PersistentVector<'T>
Returns: seq<'T>

PersistentVector.rev arg1

Full Usage: PersistentVector.rev arg1

Parameters:
Returns: PersistentVector<'T>

O(n). Returns vector reversed.

arg0 : PersistentVector<'T>
Returns: PersistentVector<'T>

PersistentVector.singleton arg1

Full Usage: PersistentVector.singleton arg1

Parameters:
    arg0 : 'T

Returns: PersistentVector<'T>

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

arg0 : 'T
Returns: PersistentVector<'T>

PersistentVector.toSeq arg1

Full Usage: PersistentVector.toSeq arg1

Parameters:
Returns: seq<'T>

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

arg0 : PersistentVector<'T>
Returns: seq<'T>

PersistentVector.tryInitial arg1

Full Usage: PersistentVector.tryInitial arg1

Parameters:
Returns: PersistentVector<'T> option

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

arg0 : PersistentVector<'T>
Returns: PersistentVector<'T> option

PersistentVector.tryLast arg1

Full Usage: PersistentVector.tryLast arg1

Parameters:
Returns: 'T option

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

arg0 : PersistentVector<'T>
Returns: 'T option

PersistentVector.tryNth arg1 arg2

Full Usage: PersistentVector.tryNth arg1 arg2

Parameters:
Returns: 'T option

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

arg0 : int
arg1 : PersistentVector<'T>
Returns: 'T option

PersistentVector.tryNthNth arg1 arg2 arg3

Full Usage: PersistentVector.tryNthNth arg1 arg2 arg3

Parameters:
Returns: 'T option

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

arg0 : int
arg1 : int
arg2 : PersistentVector<PersistentVector<'T>>
Returns: 'T option

PersistentVector.tryUnconj arg1

Full Usage: PersistentVector.tryUnconj arg1

Parameters:
Returns: (PersistentVector<'T> * 'T) option

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

arg0 : PersistentVector<'T>
Returns: (PersistentVector<'T> * 'T) option

PersistentVector.tryUpdate arg1 arg2 arg3

Full Usage: PersistentVector.tryUpdate arg1 arg2 arg3

Parameters:
Returns: PersistentVector<'T> option

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

arg0 : int
arg1 : 'T
arg2 : PersistentVector<'T>
Returns: PersistentVector<'T> option

PersistentVector.tryUpdateNth arg1 arg2 arg3 arg4

Full Usage: PersistentVector.tryUpdateNth arg1 arg2 arg3 arg4

Parameters:
Returns: PersistentVector<PersistentVector<'T>> option

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

arg0 : int
arg1 : int
arg2 : 'T
arg3 : PersistentVector<PersistentVector<'T>>
Returns: PersistentVector<PersistentVector<'T>> option

PersistentVector.unconj arg1

Full Usage: PersistentVector.unconj arg1

Parameters:
Returns: PersistentVector<'T> * 'T

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

arg0 : PersistentVector<'T>
Returns: PersistentVector<'T> * 'T

PersistentVector.update arg1 arg2 arg3

Full Usage: PersistentVector.update arg1 arg2 arg3

Parameters:
Returns: PersistentVector<'T>

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

arg0 : int
arg1 : 'T
arg2 : PersistentVector<'T>
Returns: PersistentVector<'T>

PersistentVector.updateNth arg1 arg2 arg3 arg4

Full Usage: PersistentVector.updateNth arg1 arg2 arg3 arg4

Parameters:
Returns: PersistentVector<PersistentVector<'T>>

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

arg0 : int
arg1 : int
arg2 : 'T
arg3 : PersistentVector<PersistentVector<'T>>
Returns: PersistentVector<PersistentVector<'T>>

PersistentVector.windowSeq arg1 arg2

Full Usage: PersistentVector.windowSeq arg1 arg2

Parameters:
    arg0 : int
    arg1 : seq<'T>

Returns: PersistentVector<PersistentVector<'T>>

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

arg0 : int
arg1 : seq<'T>
Returns: PersistentVector<PersistentVector<'T>>

Active patterns

Active pattern Description

PersistentVector.(|Conj|Nil|) arg1

Full Usage: PersistentVector.(|Conj|Nil|) arg1

Parameters:
Returns: Choice<(PersistentVector<'T> * 'T), unit>
arg0 : PersistentVector<'T>
Returns: Choice<(PersistentVector<'T> * 'T), unit>