Header menu logo Euclid

ResizeArr Module

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

Functions and values

Function or value Description

closeLoop pts

Full Usage: closeLoop pts

Parameters:
    pts : ResizeArray<'T>

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

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
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
predicate : 'T -> bool
xs : ResizeArray<'T>
Returns: int

iPrevThisNext xs

Full Usage: iPrevThisNext xs

Parameters:
    xs : ResizeArray<'T>

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

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
count : int
f : int -> 'T
Returns: ResizeArray<'T>

length xs

Full Usage: length xs

Parameters:
    xs : ResizeArray<'T>

Returns: int
Modifiers: inline
Type parameters: 'T

this.Count.

xs : ResizeArray<'T>
Returns: int

map mapping xs

Full Usage: map mapping xs

Parameters:
    mapping : 'T -> 'U - The function to transform elements of the ResizeArr.
    xs : ResizeArray<'T> - The input ResizeArr.

Returns: ResizeArray<'U> The ResizeArray of transformed elements.

Builds a new ResizeArray whose elements are the results of applying the given function to each of the elements of the ResizeArr.

mapping : 'T -> 'U

The function to transform elements of the ResizeArr.

xs : ResizeArray<'T>

The input ResizeArr.

Returns: ResizeArray<'U>

The ResizeArray of transformed elements.

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.

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.

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.

rev xs

Full Usage: rev xs

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

Returns: ResizeArray<'T> The reversed ResizeArr.

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.

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

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.

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.

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.