fsprojects/FSharpx.Collections


ResizeArray

Namespace: Microsoft.FSharp.Collections

Generic operations on the type System.Collections.Generic.List, which is called ResizeArray in the F# libraries.

Functions and values

Function or valueDescription
append arg1 arg2
Signature: ResizeArray<'T> -> ResizeArray<'T> -> ResizeArray<'T>
Type parameters: 'T

Build a new array that contains the elements of the first array followed by the elements of the second array

blit arg1 arg2 arg3 arg4 arg5
Signature: ResizeArray<'T> -> int -> ResizeArray<'T> -> int -> int -> unit
Type parameters: 'T

Read a range of elements from the first array and write them into the second.

choose arg1 arg2
Signature: ('T -> 'U option) -> ResizeArray<'T> -> ResizeArray<'U>
Type parameters: 'T, 'U

Apply the given function to each element of the array. Return the array comprised of the results "x" for each element where the function returns Some(x)

concat arg1
Signature: seq<ResizeArray<'T>> -> ResizeArray<'T>
Type parameters: 'T

Build a new array that contains the elements of each of the given list of arrays

copy arg1
Signature: ResizeArray<'T> -> ResizeArray<'T>
Type parameters: 'T

Build a new array that contains the elements of the given array

create arg1 arg2
Signature: int -> 'T -> ResizeArray<'T>
Type parameters: 'T

Create an array whose elements are all initially the given value.

distinct arg1
Signature: ResizeArray<'T> -> ResizeArray<'T>
Type parameters: 'T

Returns an array that contains no duplicate entries according to generic hash and equality comparisons on the entries. If an element occurs multiple times in the array then the later occurrences are discarded.

distinctBy arg1 arg2
Signature: ('T -> 'Key) -> ResizeArray<'T> -> ResizeArray<'T>
Type parameters: 'T, 'Key

Returns an array that contains no duplicate entries according to the generic hash and equality comparisons on the keys returned by the given key-generating function. If an element occurs multiple times in the array then the later occurrences are discarded.

exists arg1 arg2
Signature: ('T -> bool) -> ResizeArray<'T> -> bool
Type parameters: 'T

Test if any element of the array satisfies the given predicate. If the input function is f and the elements are i0...iN then computes p i0 or ... or p iN.

exists2 arg1 arg2 arg3
Signature: ('T1 -> 'T2 -> bool) -> ResizeArray<'T1> -> ResizeArray<'T2> -> bool
Type parameters: 'T1, 'T2

Test elements of the two arrays pairwise to see if any pair of element satisfies the given predicate. Raise ArgumentException if the arrays have different lengths.

fill arg1 arg2 arg3 arg4
Signature: ResizeArray<'T> -> int -> int -> 'T -> unit
Type parameters: 'T

Fill a range of the collection with the given element

filter arg1 arg2
Signature: ('T -> bool) -> ResizeArray<'T> -> ResizeArray<'T>
Type parameters: 'T

Return a new collection containing only the elements of the collection for which the given predicate returns true

find arg1 arg2
Signature: ('T -> bool) -> ResizeArray<'T> -> 'T
Type parameters: 'T

Return the first element for which the given function returns true. Raise KeyNotFoundException if no such element exists.

findIndex arg1 arg2
Signature: ('T -> bool) -> ResizeArray<'T> -> int
Type parameters: 'T

Return the index of the first element in the array that satisfies the given predicate. Raise KeyNotFoundException if none of the elements satisfy the predicate.

findIndexi arg1 arg2
Signature: (int -> 'T -> bool) -> ResizeArray<'T> -> int
Type parameters: 'T

Return the index of the first element in the array that satisfies the given predicate. Raise KeyNotFoundException if none of the elements satisfy the predicate.

fold arg1 arg2 arg3
Signature: ('T -> 'State -> 'T) -> 'T -> ResizeArray<'State> -> 'T
Type parameters: 'T, 'State

Apply a function to each element of the collection, threading an accumulator argument through the computation. If the input function is f and the elements are i0...iN then computes f (... (f s i0)...) iN

fold2 arg1 arg2 arg3 arg4
Signature: ('State -> 'T1 -> 'T2 -> 'State) -> 'State -> ResizeArray<'T1> -> ResizeArray<'T2> -> 'State
Type parameters: 'State, 'T1, 'T2

Apply a function to pairs of elements drawn from the two collections, left-to-right, threading an accumulator argument through the computation. The two input arrays must have the same lengths, otherwise an ArgumentException is raised.

foldBack arg1 arg2 arg3
Signature: ('T -> 'State -> 'State) -> ResizeArray<'T> -> 'State -> 'State
Type parameters: 'T, 'State

Apply a function to each element of the array, threading an accumulator argument through the computation. If the input function is f and the elements are i0...iN then computes f i0 (...(f iN s)).

foldBack2 arg1 arg2 arg3 arg4
Signature: ('T1 -> 'T2 -> 'State -> 'State) -> ResizeArray<'T1> -> ResizeArray<'T2> -> 'State -> 'State
Type parameters: 'T1, 'T2, 'State

Apply a function to pairs of elements drawn from the two collections, right-to-left, threading an accumulator argument through the computation. The two input arrays must have the same lengths, otherwise an ArgumentException is raised.

forall arg1 arg2
Signature: ('T -> bool) -> ResizeArray<'T> -> bool
Type parameters: 'T

Test if all elements of the array satisfy the given predicate. If the input function is f and the elements are i0...iN and "j0...jN" then computes p i0 && ... && p iN.

forall2 arg1 arg2 arg3
Signature: ('T1 -> 'T2 -> bool) -> ResizeArray<'T1> -> ResizeArray<'T2> -> bool
Type parameters: 'T1, 'T2

Test elements of the two arrays pairwise to see if all pairs of elements satisfy the given predicate. Raise ArgumentException if the arrays have different lengths.

get arg1 arg2
Signature: ResizeArray<'T> -> int -> 'T
Type parameters: 'T

Fetch an element from the collection. You can also use the syntax arr.[idx].

init arg1 arg2
Signature: int -> (int -> 'T) -> ResizeArray<'T>
Type parameters: 'T

Create an array by calling the given generator on each index.

isEmpty arg1
Signature: ResizeArray<'T> -> bool
Type parameters: 'T

Return true if the given array is empty, otherwise false

iter arg1 arg2
Signature: ('T -> unit) -> ResizeArray<'T> -> unit
Type parameters: 'T

Apply the given function to each element of the array.

iter2 arg1 arg2 arg3
Signature: ('T1 -> 'T2 -> unit) -> ResizeArray<'T1> -> ResizeArray<'T2> -> unit
Type parameters: 'T1, 'T2

Apply the given function to two arrays simultaneously. The two arrays must have the same lengths, otherwise an Invalid_argument exception is raised.

iteri arg1 arg2
Signature: (int -> 'T -> unit) -> ResizeArray<'T> -> unit
Type parameters: 'T

Apply the given function to each element of the array. The integer passed to the function indicates the index of element.

iteri2 arg1 arg2 arg3
Signature: (int -> 'T1 -> 'T2 -> unit) -> ResizeArray<'T1> -> ResizeArray<'T2> -> unit
Type parameters: 'T1, 'T2

Apply the given function to pair of elements drawn from matching indices in two arrays, also passing the index of the elements. The two arrays must have the same lengths, otherwise an ArgumentException is raised.

length arg1
Signature: ResizeArray<'T> -> int
Type parameters: 'T

Return the length of the collection. You can also use property arr.Length.

map arg1 arg2
Signature: ('T -> 'U) -> ResizeArray<'T> -> ResizeArray<'U>
Type parameters: 'T, 'U

Build a new array whose elements are the results of applying the given function to each of the elements of the array.

map2 arg1 arg2 arg3
Signature: ('T1 -> 'T2 -> 'U) -> ResizeArray<'T1> -> ResizeArray<'T2> -> ResizeArray<'U>
Type parameters: 'T1, 'T2, 'U

Build 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.

mapi arg1 arg2
Signature: (int -> 'T -> 'U) -> ResizeArray<'T> -> ResizeArray<'U>
Type parameters: 'T, 'U

Build a new array whose elements are the results of applying the given function to each of the elements of the array. The integer index passed to the function indicates the index of element being transformed.

mapi2 arg1 arg2 arg3
Signature: (int -> 'T1 -> 'T2 -> 'U) -> ResizeArray<'T1> -> ResizeArray<'T2> -> ResizeArray<'U>
Type parameters: 'T1, 'T2, 'U

Build 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 an ArgumentException is raised.

ofArray arg1
Signature: 'T [] -> ResizeArray<'T>
Type parameters: 'T

Build a ResizeArray from the given elements

ofList arg1
Signature: 'T list -> ResizeArray<'T>
Type parameters: 'T

Build an array from the given list

ofSeq arg1
Signature: seq<'T> -> ResizeArray<'T>
Type parameters: 'T

Build and array from the given seq

partition arg1 arg2
Signature: ('T -> bool) -> ResizeArray<'T> -> ResizeArray<'T> * ResizeArray<'T>
Type parameters: 'T

Split the collection into two collections, containing the elements for which the given predicate returns true and false respectively

reduce arg1 arg2
Signature: ('T -> 'T -> 'T) -> ResizeArray<'T> -> 'T
Type parameters: 'T

Apply a function to each element of the array, threading an accumulator argument through the computation. If the input function is f and the elements are i0...iN then computes f (... (f i0 i1)...) iN. Raises ArgumentException if the array has size zero.

reduceBack arg1 arg2
Signature: ('T -> 'T -> 'T) -> ResizeArray<'T> -> 'T
Type parameters: 'T

Apply a function to each element of the array, threading an accumulator argument through the computation. If the input function is f and the elements are i0...iN then computes f i0 (...(f iN-1 iN)). Raises ArgumentException if the array has size zero.

rev arg1
Signature: ResizeArray<'T> -> ResizeArray<'T>
Type parameters: 'T

Return a new array with the elements in reverse order

scan arg1 arg2 arg3
Signature: ('State -> 'T -> 'State) -> 'State -> ResizeArray<'T> -> ResizeArray<'State>
Type parameters: 'State, 'T

Like fold, but return the intermediary and final results

scanBack arg1 arg2 arg3
Signature: ('T -> 'State -> 'State) -> ResizeArray<'T> -> 'State -> ResizeArray<'State>
Type parameters: 'T, 'State

Like foldBack, but return both the intermediary and final results

set arg1 arg2 arg3
Signature: ResizeArray<'T> -> int -> 'T -> unit
Type parameters: 'T

Set the value of an element in the collection. You can also use the syntax arr.[idx] <- e.

singleton arg1
Signature: 'T -> ResizeArray<'T>
Type parameters: 'T

Return an array containing the given element

sort arg1 arg2
Signature: ('T -> 'T -> int) -> ResizeArray<'T> -> unit
Type parameters: 'T

Sort the elements using the given comparison function

sortBy arg1 arg2
Signature: ('T -> 'Key) -> ResizeArray<'T> -> unit
Type parameters: 'T, 'Key

Sort the elements using the key extractor and generic comparison on the keys

sub arg1 arg2 arg3
Signature: ResizeArray<'T> -> int -> int -> ResizeArray<'T>
Type parameters: 'T

Build a new array that contains the given subrange specified by starting index and length.

toArray arg1
Signature: ResizeArray<'T> -> 'T []
Type parameters: 'T

Return a fixed-length array containing the elements of the input ResizeArray

toList arg1
Signature: ResizeArray<'T> -> 'T list
Type parameters: 'T

Build a list from the given array

toSeq arg1
Signature: ResizeArray<'T> -> seq<'T>
Type parameters: 'T

Return a view of the array as an enumerable object

tryFind arg1 arg2
Signature: ('T -> bool) -> ResizeArray<'T> -> 'T option
Type parameters: 'T

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

tryFindIndex arg1 arg2
Signature: ('T -> bool) -> ResizeArray<'T> -> int option
Type parameters: 'T

Return the index of the first element in the array that satisfies the given predicate.

tryFindIndexi arg1 arg2
Signature: (int -> 'T -> bool) -> ResizeArray<'T> -> int option
Type parameters: 'T

Return the index of the first element in the array that satisfies the given predicate.

tryPick arg1 arg2
Signature: ('T -> 'U option) -> ResizeArray<'T> -> 'U option
Type parameters: 'T, 'U

Apply the given function to successive elements, returning the first result where function returns "Some(x)" for some x.

unzip arg1
Signature: ResizeArray<'T1 * 'T2> -> ResizeArray<'T1> * ResizeArray<'T2>
Type parameters: 'T1, 'T2

Split an array of pairs into two arrays

zip arg1 arg2
Signature: ResizeArray<'T1> -> ResizeArray<'T2> -> ResizeArray<'T1 * 'T2>
Type parameters: 'T1, 'T2

Combine the two arrays into an array of pairs. The two arrays must have equal lengths, otherwise an ArgumentException is raised..

Fork me on GitHub