Logo ResizeArray

AutoOpenResizeArrayExtensions Module

Extension methods for ResizeArray<'T>. This module is automatically opened when the namespace ResizeArrayT is opened.

Type extensions

Type extension Description

this.AsString

Full Usage: this.AsString

Parameters:
    () : unit

Returns: string

A string representation of the ResizeArray including the count of entries and the first 5 entries. When used in Fable this member is inlined for reflection to work.

Extended Type: List

() : unit
Returns: string

this.Clone

Full Usage: this.Clone

Parameters:
    () : unit

Returns: List<'T>
Modifiers: inline

Creates a new ResizeArray that contains a shallow copy of the elements. Same as xs.Duplicate().

Extended Type: List

() : unit
Returns: List<'T>

this.DebugIdx

Full Usage: this.DebugIdx

Parameters:
    () : unit

Returns: DebugIndexer<'T>

Use for Debugging index get/set operations. Just replace 'myList.[3]' with 'myList.DebugIdx.[3]' Throws a descriptive exception if the index is out of range, including the bad index and the ResizeArray content.

Extended Type: List

() : unit
Returns: DebugIndexer<'T>

this.Duplicate

Full Usage: this.Duplicate

Parameters:
    () : unit

Returns: ResizeArray<'T>

Creates a new ResizeArray with the same items as the input ResizeArray. This is a shallow element copy. Same as xs.Clone().

Extended Type: List

() : unit
Returns: ResizeArray<'T>

this.FailIfEmpty

Full Usage: this.FailIfEmpty

Parameters:
    errorMessage : string

Returns: ResizeArray<'T>
Modifiers: inline

Returns the input ResizeArray for chaining, or raises an exception if it is empty.

Extended Type: List

errorMessage : string
Returns: ResizeArray<'T>

this.FailIfLessThan

Full Usage: this.FailIfLessThan

Parameters:
    count : int
    errorMessage : string

Returns: ResizeArray<'T>
Modifiers: inline

Returns the input ResizeArray for chaining, or raises an exception if it has fewer than count elements.

Extended Type: List

count : int
errorMessage : string
Returns: ResizeArray<'T>

this.First

Full Usage: this.First

Parameters:
    () : unit

Returns: 'T
Modifiers: inline

Gets or sets the first element of the ResizeArray. Same as this.[0].

Extended Type: List

() : unit
Returns: 'T

this.FirstAndOnly

Full Usage: this.FirstAndOnly

Parameters:
    () : unit

Returns: 'T
Modifiers: inline

Gets the only element of the ResizeArray. Fails if the ResizeArray does not have exactly one element.

Extended Type: List

() : unit
Returns: 'T

this.Get

Full Usage: this.Get

Parameters:
    index : int - The zero-based index of the element to get.

Returns: 'T The element at the specified index.
Modifiers: inline

Gets the element at the specified index. Same as this.[index] or this.Idx(index). Use this.GetNeg(index) if you want to use negative indices too.

Extended Type: List

index : int

The zero-based index of the element to get.

Returns: 'T

The element at the specified index.

IndexOutOfRangeException Thrown when the index is negative or the ResizeArray does not contain enough elements.

this.GetLooped

Full Usage: this.GetLooped

Parameters:
    index : int - The index to normalize into the bounds of the ResizeArray.

Returns: 'T The element at the normalized index.
Modifiers: inline

Gets the element at the specified index, treating the ResizeArray as circular in both directions.

Extended Type: List

index : int

The index to normalize into the bounds of the ResizeArray.

Returns: 'T

The element at the normalized index.

IndexOutOfRangeException Thrown when the ResizeArray is empty.

this.GetNeg

Full Usage: this.GetNeg

Parameters:
    index : int - The index of the element to get.

Returns: 'T The element at the specified index.
Modifiers: inline

Gets the element at the specified index. A negative index counts backward from the end; -1 is the last element.

Extended Type: List

index : int

The index of the element to get.

Returns: 'T

The element at the specified index.

IndexOutOfRangeException Thrown when the index is outside the ResizeArray or the ResizeArray is empty.

this.GetReverseIndex

Full Usage: this.GetReverseIndex

Parameters:
    arg0 : 'a
    offset : int - The offset from the end.

Returns: int The corresponding index from the start.
Type parameters: 'a

Get the index for the element offset elements away from the end of the collection. This member exists to support F# indexing from back: ^0 is last item, ^1 is second last

Extended Type: List

arg0 : 'a
offset : int

The offset from the end.

Returns: int

The corresponding index from the start.

this.GetSlice

Full Usage: this.GetSlice

Parameters:
    startIdx : int option
    endIdx : int option

Returns: ResizeArray<'T>

This member enables the F# slicing notation operator, for example xs.[1..3]. The resulting ResizeArray includes the end index. Just like for F# arrays, out-of-bounds indices are ignored when getting a slice, but not when setting one. The start index is inclusive and the end index is also inclusive.

With F# preview features enabled a negative index can also be done with '^' prefix. E.g. ^0 for the last item.

Extended Type: List

startIdx : int option
endIdx : int option
Returns: ResizeArray<'T>

this.HasItems

Full Usage: this.HasItems

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Returns true if the ResizeArray has one or more elements; otherwise, false. Same as xs.IsNotEmpty. Unlike ResizeArray.hasItems, this property does not test for an exact count.

Extended Type: List

() : unit
Returns: bool

this.Idx

Full Usage: this.Idx

Parameters:
    index : int

Returns: 'T
Modifiers: inline

Gets an item at index, same as this.[index] or this.Get(index) Throws a descriptive exception if the index is out of range. (Use this.GetNeg(i) member if you want to use negative indices too)

Extended Type: List

index : int
Returns: 'T

this.InsertAtStart

Full Usage: this.InsertAtStart

Parameters:
    x : 'T

Modifiers: inline

Insert an item at the beginning of the list = index 0, (moving all other items up by one index)

Extended Type: List

x : 'T

this.IsEmpty

Full Usage: this.IsEmpty

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Returns true if the ResizeArray is empty; otherwise, false.

Extended Type: List

() : unit
Returns: bool

this.IsEqualTo

Full Usage: this.IsEqualTo

Parameters:
    other : ResizeArray<'T>

Returns: bool

Shallow Structural equality comparison. Compares each element in both lists for equality. However nested ResizeArrays inside a ResizeArray are only compared for referential equality in .NET. When used in Fable (JavaScript) the nested ResizeArrays are compared for structural equality as per the Fable implementation of Javascript Arrays. (Like the default behavior of Collections.Generic.List) Does not raise ArgumentNullException if either or both lists are null.

Extended Type: List

other : ResizeArray<'T>
Returns: bool

this.IsNotEmpty

Full Usage: this.IsNotEmpty

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Returns true if the ResizeArray has one or more elements; otherwise, false. Same as xs.HasItems.

Extended Type: List

() : unit
Returns: bool

this.IsSingleton

Full Usage: this.IsSingleton

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Returns true if the ResizeArray has exactly one element; otherwise, false.

Extended Type: List

() : unit
Returns: bool

this.Last

Full Usage: this.Last

Parameters:
    () : unit

Returns: 'T
Modifiers: inline

Gets or sets the last element of the ResizeArray. Same as this.[this.Count - 1].

Extended Type: List

() : unit
Returns: 'T

this.LastIndex

Full Usage: this.LastIndex

Parameters:
    () : unit

Returns: int
Modifiers: inline

Gets the index of the last item in the ResizeArray. Equal to this.Count - 1 Returns -1 for empty ResizeArray.

Extended Type: List

() : unit
Returns: int

this.Pop

Full Usage: this.Pop

Parameters:
    () : unit

Returns: 'T The removed element.
Modifiers: inline

Removes and returns the last element of the ResizeArray.

In Fable, this emits .pop(). In .NET, it removes the element at Count - 1.

Extended Type: List

() : unit
Returns: 'T

The removed element.

ArgumentException Thrown when the ResizeArray is empty.

this.Pop

Full Usage: this.Pop

Parameters:
    index : int - The zero-based index of the element to remove.

Returns: 'T The removed element.
Modifiers: inline

Removes and returns the element at the specified index.

Extended Type: List

index : int

The zero-based index of the element to remove.

Returns: 'T

The removed element.

IndexOutOfRangeException Thrown when the index is outside the ResizeArray.

this.PopOff

Full Usage: this.PopOff

Parameters:
    () : unit

Modifiers: inline

Removes the last element of the ResizeArray without returning it.

In Fable, this emits .pop(). In .NET, it removes the element at Count - 1.

Extended Type: List

() : unit
ArgumentException Thrown when the ResizeArray is empty.

this.Second

Full Usage: this.Second

Parameters:
    () : unit

Returns: 'T
Modifiers: inline

Gets or sets the second element of the ResizeArray. Same as this.[1].

Extended Type: List

() : unit
Returns: 'T

this.SecondLast

Full Usage: this.SecondLast

Parameters:
    () : unit

Returns: 'T
Modifiers: inline

Gets or sets the second-last element of the ResizeArray. Same as this.[this.Count - 2].

Extended Type: List

() : unit
Returns: 'T

this.Set

Full Usage: this.Set

Parameters:
    index : int - The zero-based index of the element to set.
    value : 'T - The new value.

Modifiers: inline

Sets the element at the specified index. Use this.SetNeg(index, value) if you want to use negative indices too.

Extended Type: List

index : int

The zero-based index of the element to set.

value : 'T

The new value.

IndexOutOfRangeException Thrown when the index is negative or the ResizeArray does not contain enough elements.

this.SetLooped

Full Usage: this.SetLooped

Parameters:
    index : int - The index to normalize into the bounds of the ResizeArray.
    value : 'T - The new value.

Modifiers: inline

Sets the element at the specified index, treating the ResizeArray as circular in both directions.

Extended Type: List

index : int

The index to normalize into the bounds of the ResizeArray.

value : 'T

The new value.

IndexOutOfRangeException Thrown when the ResizeArray is empty.

this.SetNeg

Full Usage: this.SetNeg

Parameters:
    index : int - The index of the element to set.
    value : 'T - The new value.

Modifiers: inline

Sets the element at the specified index. A negative index counts backward from the end; -1 is the last element.

Extended Type: List

index : int

The index of the element to set.

value : 'T

The new value.

IndexOutOfRangeException Thrown when the index is outside the ResizeArray or the ResizeArray is empty.

this.SetSlice

Full Usage: this.SetSlice

Parameters:
    startIdx : int option
    endIdx : int option
    newValues : IList<'T>

This member enables F# slicing notation operator e.g.: xs.[1..3] <- ys. The end index is included. Just like for F# arrays, out-of-bounds indices raise an exception when setting a slice, but not when getting one. If the list of new values is longer than the slice, the extra values are ignored (just like for F# arrays).

With F# preview features enabled a negative index can also be done with '^' prefix. E.g. ^0 for the last item.

Extended Type: List

startIdx : int option
endIdx : int option
newValues : IList<'T>
IndexOutOfRangeException Thrown when either bound is outside the ResizeArray, the start index is greater than the end index, or newValues contains too few elements.

this.SliceIdx

Full Usage: this.SliceIdx

Parameters:
    startIdx : int - The inclusive start index of the slice.
    endIdx : int - The inclusive end index of the slice.

Returns: ResizeArray<'T> A new ResizeArray containing the requested range.

Returns a new ResizeArray containing the elements between the specified inclusive start and end indices. This member rejects out-of-bounds indices, while the F# slicing notation xs.[1..3] does not. To normalize negative or out-of-range indices, use SliceLooped. Do not confuse this method with the new xs.Slice(start , length) method, that is built into .NET

Alternative: with F# slicing notation (e.g. a.[1..3]) With F# preview features enabled a negative index can also be done with '^' prefix. E.g. ^0 for the last item.

Extended Type: List

startIdx : int

The inclusive start index of the slice.

endIdx : int

The inclusive end index of the slice.

Returns: ResizeArray<'T>

A new ResizeArray containing the requested range.

IndexOutOfRangeException Thrown when either index is outside the ResizeArray or startIdx is greater than endIdx.

this.SliceLooped

Full Usage: this.SliceLooped

Parameters:
    startIdx : int - The inclusive start index to normalize.
    endIdx : int - The inclusive end index to normalize.

Returns: ResizeArray<'T> A new ResizeArray containing the requested range.

Returns a new ResizeArray containing the elements between the specified start and end indices after normalizing both indices with modulo. Both indices are inclusive, and negative and out-of-range indices are allowed. If the normalized start index is greater than the normalized end index, an empty ResizeArray is returned. For an empty input ResizeArray, an empty ResizeArray is returned.

Alternative: with F# slicing notation (e.g. a.[1..3]) With F# preview features enabled a negative index can also be done with '^' prefix. E.g. ^0 for the last item.

Extended Type: List

startIdx : int

The inclusive start index to normalize.

endIdx : int

The inclusive end index to normalize.

Returns: ResizeArray<'T>

A new ResizeArray containing the requested range.

this.Third

Full Usage: this.Third

Parameters:
    () : unit

Returns: 'T
Modifiers: inline

Gets or sets the third element of the ResizeArray. Same as this.[2].

Extended Type: List

() : unit
Returns: 'T

this.ThirdLast

Full Usage: this.ThirdLast

Parameters:
    () : unit

Returns: 'T
Modifiers: inline

Gets or sets the third-last element of the ResizeArray. Same as this.[this.Count - 3].

Extended Type: List

() : unit
Returns: 'T

this.ToString

Full Usage: this.ToString

Parameters:
    entriesToPrint : int

Returns: string

A string representation of the ResizeArray including the count of entries and the specified amount of entries. When used in Fable this member is inlined for reflection to work.

Extended Type: List

entriesToPrint : int
Returns: string

Type something to start searching.