FSharpx.Collections


RandomAccessList Module

Defines functions which allow to access and manipulate RandomAccessLists.

Functions and values

Function or value Description

RandomAccessList.append arg1 arg2

Full Usage: RandomAccessList.append arg1 arg2

Parameters:
Returns: RandomAccessList<'T>

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

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

RandomAccessList.cons arg1 arg2

Full Usage: RandomAccessList.cons arg1 arg2

Parameters:
Returns: RandomAccessList<'T>

O(1). Returns a new random access list with the element added at the start.

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

RandomAccessList.empty

Full Usage: RandomAccessList.empty

Returns: RandomAccessList<'T>

O(1). Returns random access list of no elements.

Returns: RandomAccessList<'T>

RandomAccessList.fold arg1 arg2 arg3

Full Usage: RandomAccessList.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 : RandomAccessList<'T>
Returns: 'State

RandomAccessList.foldBack arg1 arg2 arg3

Full Usage: RandomAccessList.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 : RandomAccessList<'T>
arg2 : 'State
Returns: 'State

RandomAccessList.head arg1

Full Usage: RandomAccessList.head arg1

Parameters:
Returns: 'T

O(1). Returns the first element in the random access list. If the random access list is empty it throws an exception.

arg0 : RandomAccessList<'T>
Returns: 'T

RandomAccessList.init arg1 arg2

Full Usage: RandomAccessList.init arg1 arg2

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

Returns: RandomAccessList<'T>

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

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

RandomAccessList.isEmpty arg1

Full Usage: RandomAccessList.isEmpty arg1

Parameters:
Returns: bool

O(1). Returns true if the random access list has no elements.

arg0 : RandomAccessList<'T>
Returns: bool

RandomAccessList.length arg1

Full Usage: RandomAccessList.length arg1

Parameters:
Returns: int

O(1). Returns the number of items in the random access list.

arg0 : RandomAccessList<'T>
Returns: int

RandomAccessList.map arg1 arg2

Full Usage: RandomAccessList.map arg1 arg2

Parameters:
Returns: RandomAccessList<'T1>

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

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

RandomAccessList.map2 arg1 randomAccessList1 randomAccessList2

Full Usage: RandomAccessList.map2 arg1 randomAccessList1 randomAccessList2

Parameters:
Returns: RandomAccessList<'U>

O(n). Builds a new collection whose elements are the results of applying the given function to the corresponding elements of the two collections pairwise. The two input arrays must have the same lengths, otherwise ArgumentException is raised.

arg0 : 'T1 -> 'T2 -> 'U
randomAccessList1 : RandomAccessList<'T1>
randomAccessList2 : RandomAccessList<'T2>
Returns: RandomAccessList<'U>

RandomAccessList.nth arg1 arg2

Full Usage: RandomAccessList.nth arg1 arg2

Parameters:
Returns: 'T

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

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

RandomAccessList.nthNth arg1 arg2 arg3

Full Usage: RandomAccessList.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 : RandomAccessList<RandomAccessList<'T>>
Returns: 'T

RandomAccessList.ofSeq arg1

Full Usage: RandomAccessList.ofSeq arg1

Parameters:
    arg0 : seq<'T>

Returns: RandomAccessList<'T>

O(n). Returns a random access list of the seq.

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

RandomAccessList.reduce f randomAccessList

Full Usage: RandomAccessList.reduce f randomAccessList

Parameters:
Returns: 'T

O(n). Applies a function to each element of the collection, threading an accumulator argument through the computation. This function first applies the function to the first two elements of the list. Then, it passes this result into the function along with the third element and so on. Finally, it returns the final result. If the input function is f and the elements are i0...iN, then it computes f (... (f i0 i1) i2 ...) iN.

f : 'T -> 'T -> 'T
randomAccessList : RandomAccessList<'T>
Returns: 'T

RandomAccessList.rev arg1

Full Usage: RandomAccessList.rev arg1

Parameters:
Returns: RandomAccessList<'T>

O(n). Returns new random access list reversed.

arg0 : RandomAccessList<'T>
Returns: RandomAccessList<'T>

RandomAccessList.singleton arg1

Full Usage: RandomAccessList.singleton arg1

Parameters:
    arg0 : 'T

Returns: RandomAccessList<'T>

O(1). Returns a new random access list of one element.

arg0 : 'T
Returns: RandomAccessList<'T>

RandomAccessList.tail arg1

Full Usage: RandomAccessList.tail arg1

Parameters:
Returns: RandomAccessList<'T>

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

arg0 : RandomAccessList<'T>
Returns: RandomAccessList<'T>

RandomAccessList.toSeq arg1

Full Usage: RandomAccessList.toSeq arg1

Parameters:
Returns: seq<'T>

O(n). Views the given random access list as a sequence.

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

RandomAccessList.tryHead arg1

Full Usage: RandomAccessList.tryHead arg1

Parameters:
Returns: 'T option

O(1). Returns option first element in the random access list.

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

RandomAccessList.tryNth arg1 arg2

Full Usage: RandomAccessList.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 : RandomAccessList<'T>
Returns: 'T option

RandomAccessList.tryNthNth arg1 arg2 arg3

Full Usage: RandomAccessList.tryNthNth arg1 arg2 arg3

Parameters:
Returns: 'T option

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

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

RandomAccessList.tryTail arg1

Full Usage: RandomAccessList.tryTail arg1

Parameters:
Returns: RandomAccessList<'T> option

O(1) for all practical purposes; really O(log32n). Returns option random access list without the first item.

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

RandomAccessList.tryUncons arg1

Full Usage: RandomAccessList.tryUncons arg1

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

O(1) for all practical purposes; really O(log32n). Returns option tuple first element and random access list without first item

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

RandomAccessList.tryUpdate arg1 arg2 arg3

Full Usage: RandomAccessList.tryUpdate arg1 arg2 arg3

Parameters:
Returns: RandomAccessList<'T> option

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

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

RandomAccessList.tryUpdateNth arg1 arg2 arg3 arg4

Full Usage: RandomAccessList.tryUpdateNth arg1 arg2 arg3 arg4

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

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

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

RandomAccessList.uncons arg1

Full Usage: RandomAccessList.uncons arg1

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

O(1) for all practical purposes; really O(log32n). Returns tuple first element and random access list without first item

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

RandomAccessList.update arg1 arg2 arg3

Full Usage: RandomAccessList.update arg1 arg2 arg3

Parameters:
Returns: RandomAccessList<'T>

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

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

RandomAccessList.updateNth arg1 arg2 arg3 arg4

Full Usage: RandomAccessList.updateNth arg1 arg2 arg3 arg4

Parameters:
Returns: RandomAccessList<RandomAccessList<'T>>

O(log32(m,n)). Returns a new random access list of random access lists that contains the given value at the indices.

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

RandomAccessList.windowSeq arg1 arg2

Full Usage: RandomAccessList.windowSeq arg1 arg2

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

Returns: RandomAccessList<RandomAccessList<'T>>

O(n). Returns a random access list of random access lists of given length from the seq. Result may be a jagged random access list.

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

RandomAccessList.zip randomAccessList1 randomAccessList2

Full Usage: RandomAccessList.zip randomAccessList1 randomAccessList2

Parameters:
Returns: RandomAccessList<'T * 'T2>

O(n). Combines the two RandomAccessLists into a RandomAccessList of pairs. The two RandomAccessLists must have equal lengths, otherwise an ArgumentException is raised.

randomAccessList1 : RandomAccessList<'T>
randomAccessList2 : RandomAccessList<'T2>
Returns: RandomAccessList<'T * 'T2>

Active patterns

Active pattern Description

RandomAccessList.(|Cons|Nil|) arg1

Full Usage: RandomAccessList.(|Cons|Nil|) arg1

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