FSharpx.Collections


Array Module

Extensions for F#'s Array module.

Functions and values

Function or value Description

Array.catOptions xs

Full Usage: Array.catOptions xs

Parameters:
Returns: 'a[]

The catOptions function takes a list of Options and returns an array of all the Some values.

xs : Option<'a>[]
Returns: 'a[]

Array.centeredWindow n source

Full Usage: Array.centeredWindow n source

Parameters:
    n : int
    source : 'a[]

Returns: 'a[][]

Returns an array of sliding windows of data drawn from the source array. Each window contains the n elements surrounding the current element.

n : int
source : 'a[]
Returns: 'a[][]

Array.centralMovingAverage n a

Full Usage: Array.centralMovingAverage n a

Parameters:
    n : int
    a : ^t[]

Returns: ^t[]

Calculates the central moving average for the array using n elements either side of the point where the mean is being calculated.

n : int
a : ^t[]
Returns: ^t[]

Array.centralMovingAverageOfOption n a

Full Usage: Array.centralMovingAverageOfOption n a

Parameters:
    n : int
    a : ^t option array

Returns: ^t option[]

Calculates the central moving average for the array of optional elements using n elements either side of the point where the mean is being calculated. If any of the optional elements in the averaging window are None then the average itself is None.

n : int
a : ^t option array
Returns: ^t option[]

Array.choice1s xs

Full Usage: Array.choice1s xs

Parameters:
Returns: 'a[]

Extracts from an array of Choice all the Choice1Of2 elements. All the Choice1Of2 elements are extracted in order.

xs : Choice<'a, 'b>[]
Returns: 'a[]

Array.choice2s xs

Full Usage: Array.choice2s xs

Parameters:
Returns: 'b[]

Extracts from an array of Choice all the Choice2Of2 elements. All the Choice2Of2 elements are extracted in order.

xs : Choice<'a, 'b>[]
Returns: 'b[]

Array.copyTo sourceStartIndx startIndx source target

Full Usage: Array.copyTo sourceStartIndx startIndx source target

Parameters:
    sourceStartIndx : int
    startIndx : int
    source : 'a[]
    target : 'a[]

copy items from one array to another

sourceStartIndx : int
startIndx : int
source : 'a[]
target : 'a[]

Array.equalsWith eq xs ys

Full Usage: Array.equalsWith eq xs ys

Parameters:
    eq : 'a -> 'a -> bool
    xs : 'a[]
    ys : 'a[]

Returns: bool

Compares two arrays for equality using the given comparison function, element by element.

eq : 'a -> 'a -> bool
xs : 'a[]
ys : 'a[]
Returns: bool

Array.nth i arr

Full Usage: Array.nth i arr

Parameters:
    i : int
    arr : 'a[]

Returns: 'a

nth item of array

i : int
arr : 'a[]
Returns: 'a

Array.ofTuple source

Full Usage: Array.ofTuple source

Parameters:
    source : obj

Returns: obj array
source : obj
Returns: obj array

Array.partitionChoices xs

Full Usage: Array.partitionChoices xs

Parameters:
Returns: 'a[] * 'b[]

Partitions an array of Choice into two arrays. All the Choice1Of2 elements are extracted, in order, to the first component of the output. Similarly the Choice2Of2 elements are extracted to the second component of the output.

xs : Choice<'a, 'b>[]
Returns: 'a[] * 'b[]

Array.setAt i v arr

Full Usage: Array.setAt i v arr

Parameters:
    i : int
    v : 'a
    arr : 'a[]

Returns: 'a[]

set the ith item of array

i : int
v : 'a
arr : 'a[]
Returns: 'a[]

Array.toTuple source

Full Usage: Array.toTuple source

Parameters:
    source : 'T array

Returns: 't

needs doc

source : 'T array
Returns: 't