FSharpx.Collections


ResizeArray

Namespace: Microsoft.FSharp.Collections
Attributes:
[<RequireQualifiedAccess>]

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

Functions and values

Function or valueDescription
ResizeArray.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

ResizeArray.blit(...)
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.

ResizeArray.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)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

ResizeArray.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)).

ResizeArray.foldBack2(...)
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.

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

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

ResizeArray.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].

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

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

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

Return true if the given array is empty, otherwise false

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

Apply the given function to each element of the array.

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

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

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

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

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

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

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

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

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

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

Build a ResizeArray from the given elements

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

Build an array from the given list

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

Build and array from the given seq

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

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

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

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

Return a new array with the elements in reverse order

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

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

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

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

Return an array containing the given element

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

Sort the elements using the given comparison function

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

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

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

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

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

Build a list from the given array

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

Return a view of the array as an enumerable object

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

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

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

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

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

Split an array of pairs into two arrays

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