Logo Euclid

ResizeArr Module

An internal module with functions for working with ResizeArray<'T>.

Functions and values

Function or value Description

clear arr

Full Usage: clear arr

Parameters:
    arr : ResizeArray<'T>

Modifiers: inline
Type parameters: 'T

this is more efficient than ResizeArray.Clear() in Fable, which emits .splice(0)

arr : ResizeArray<'T>

clone resizeArray

Full Usage: clone resizeArray

Parameters:
    resizeArray : ResizeArray<'T>

Returns: ResizeArray<'T>
Modifiers: inline
Type parameters: 'T

returns a clone of the ResizeArray, but optimized in Fable

resizeArray : ResizeArray<'T>
Returns: ResizeArray<'T>

closeLoop pts

Full Usage: closeLoop pts

Parameters:
    pts : ResizeArray<'T>

Returns: ResizeArray<'T>
Type parameters: 'T

Creates a shallow copy of the input ResizeArray and adds the first element to the end, closing the loop.

pts : ResizeArray<'T>
Returns: ResizeArray<'T>

find predicate xs

Full Usage: find predicate xs

Parameters:
    predicate : 'T -> bool
    xs : ResizeArray<'T>

Returns: 'T
Type parameters: 'T
predicate : 'T -> bool
xs : ResizeArray<'T>
Returns: 'T

findIndex predicate xs

Full Usage: findIndex predicate xs

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    xs : ResizeArray<'T> - The input ResizeArr.

Returns: int The index of the first element that satisfies the predicate, or -1 .
Type parameters: 'T

Returns the index of the first element in the ResizeArray that satisfies the given predicate.

predicate : 'T -> bool

The function to test the input elements.

xs : ResizeArray<'T>

The input ResizeArr.

Returns: int

The index of the first element that satisfies the predicate, or -1 .

findLast predicate xs

Full Usage: findLast predicate xs

Parameters:
    predicate : 'T -> bool
    xs : ResizeArray<'T>

Returns: 'T
Type parameters: 'T
predicate : 'T -> bool
xs : ResizeArray<'T>
Returns: 'T

findLastIndex predicate xs

Full Usage: findLastIndex predicate xs

Parameters:
    predicate : 'T -> bool
    xs : ResizeArray<'T>

Returns: int
Type parameters: 'T
predicate : 'T -> bool
xs : ResizeArray<'T>
Returns: int

iPrevThisNext xs

Full Usage: iPrevThisNext xs

Parameters:
    xs : ResizeArray<'T>

Returns: (int * 'T * 'T * 'T) seq
Type parameters: 'T

Yields looped Seq from (1, last, first, second) up to (lastIndex, second-last, last, first) The resulting seq has the same element count as the input Rarr.

xs : ResizeArray<'T>
Returns: (int * 'T * 'T * 'T) seq

init count f

Full Usage: init count f

Parameters:
    count : int
    f : int -> 'T

Returns: ResizeArray<'T>
Modifiers: inline
Type parameters: 'T

DO NOT USE with numbers, they are Float64Arrays in Fable .

count : int
f : int -> 'T
Returns: ResizeArray<'T>

lastIdx resizeArray

Full Usage: lastIdx resizeArray

Parameters:
    resizeArray : ResizeArray<'T>

Returns: int
Modifiers: inline
Type parameters: 'T

returns resizeArray.Count - 1 , but optimized in Fable

resizeArray : ResizeArray<'T>
Returns: int

len resizeArray

Full Usage: len resizeArray

Parameters:
    resizeArray : ResizeArray<'T>

Returns: int
Modifiers: inline
Type parameters: 'T

returns resizeArray.Count , but optimized in Fable

resizeArray : ResizeArray<'T>
Returns: int

map mapping resizeArray

Full Usage: map mapping resizeArray

Parameters:
    mapping : 'T -> 'U
    resizeArray : ResizeArray<'T>

Returns: ResizeArray<'U>
Modifiers: inline
Type parameters: 'T, 'U
mapping : 'T -> 'U
resizeArray : ResizeArray<'T>
Returns: ResizeArray<'U>

maxIndexBy projection xs

Full Usage: maxIndexBy projection xs

Parameters:
    projection : 'T -> 'Key - The function to transform the elements into a type supporting comparison.
    xs : ResizeArray<'T> - The input ResizeArr.

Returns: int The index of the maximum element.
Type parameters: 'T, 'Key (requires comparison)

Returns the index of the greatest of all elements of the ResizeArray, compared via Operators.max on the function result.

projection : 'T -> 'Key

The function to transform the elements into a type supporting comparison.

xs : ResizeArray<'T>

The input ResizeArr.

Returns: int

The index of the maximum element.

minIndexBy projection xs

Full Usage: minIndexBy projection xs

Parameters:
    projection : 'T -> 'Key - The function to transform the elements into a type supporting comparison.
    xs : ResizeArray<'T> - The input ResizeArr.

Returns: int The index of the smallest element.
Type parameters: 'T, 'Key (requires comparison)

Returns the index of the smallest of all elements of the ResizeArray, compared via Operators.max on the function result.

projection : 'T -> 'Key

The function to transform the elements into a type supporting comparison.

xs : ResizeArray<'T>

The input ResizeArr.

Returns: int

The index of the smallest element.

pop arr

Full Usage: pop arr

Parameters:
    arr : ResizeArray<'T>

Returns: 'T
Modifiers: inline
Type parameters: 'T
arr : ResizeArray<'T>
Returns: 'T

popOff arr

Full Usage: popOff arr

Parameters:
    arr : ResizeArray<'T>

Modifiers: inline
Type parameters: 'T
arr : ResizeArray<'T>

rev xs

Full Usage: rev xs

Parameters:
    xs : ResizeArray<'T> - The input ResizeArr.

Returns: ResizeArray<'T> The reversed ResizeArr.
Type parameters: 'T

Returns a new ResizeArray with the elements in reverse order.

xs : ResizeArray<'T>

The input ResizeArr.

Returns: ResizeArray<'T>

The reversed ResizeArr.

singleton x

Full Usage: singleton x

Parameters:
    x : 'T

Returns: ResizeArray<'T>
Modifiers: inline
Type parameters: 'T
x : 'T
Returns: ResizeArray<'T>

sortBy projection xs

Full Usage: sortBy projection xs

Parameters:
    projection : 'T -> 'Key - The function to transform ResizeArray elements into the type that is compared.
    xs : ResizeArray<'T> - The input ResizeArr.

Returns: ResizeArray<'T> The sorted ResizeArr.
Type parameters: 'T, 'Key (requires comparison)

Sorts the elements of a ResizeArray, using the given projection for the keys and returning a new ResizeArr. Elements are compared using Operators.compare. This means "Z" is before "a". This is different from Collections.Generic.List.Sort() where "a" is before "Z" using IComparable interface. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.

projection : 'T -> 'Key

The function to transform ResizeArray elements into the type that is compared.

xs : ResizeArray<'T>

The input ResizeArr.

Returns: ResizeArray<'T>

The sorted ResizeArr.

thisNext rarr

Full Usage: thisNext rarr

Parameters:
    rarr : ResizeArray<'T>

Returns: ('T * 'T) seq
Type parameters: 'T

Yields looped Seq from (first, second) up to (last, first). The resulting seq has the same element count as the input Rarr.

rarr : ResizeArray<'T>
Returns: ('T * 'T) seq

tryFindBack predicate resizeArray

Full Usage: tryFindBack predicate resizeArray

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: 'T option The last element that satisfies the predicate, or None.
Type parameters: 'T

Returns the last element for which the given function returns true. Return None if no such element exists.

predicate : 'T -> bool

The function to test the input elements.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: 'T option

The last element that satisfies the predicate, or None.

tryFindIndex predicate xs

Full Usage: tryFindIndex predicate xs

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    xs : ResizeArray<'T> - The input ResizeArr.

Returns: int option The index of the first element that satisfies the predicate, or None.
Type parameters: 'T

Returns the index of the first element in the ResizeArray that satisfies the given predicate.

predicate : 'T -> bool

The function to test the input elements.

xs : ResizeArray<'T>

The input ResizeArr.

Returns: int option

The index of the first element that satisfies the predicate, or None.

Type something to start searching.