Header menu logo ArrayT

Array Module

The main module for functions on Array<'T>. This module provides additional functions to ones from FSharp.Core.Array module.

Functions and values

Function or value Description

asArray arr

Full Usage: asArray arr

Parameters:
    arr : ResizeArray<'T>

Returns: 'T[]
Modifiers: inline
Type parameters: 'T

Return a fixed-length Array containing the elements of the input ResizeArray as a copy. When this function is used in Fable (JavaScript) the ResizeArray is just casted to an Array. In .NET a new Array is still allocated and the elements are copied.

arr : ResizeArray<'T>
Returns: 'T[]

asResizeArray arr

Full Usage: asResizeArray arr

Parameters:
    arr : 'T[]

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

Builds a new Array from the given ResizeArray. In Fable-JavaScript the ResizeArray is just casted to an Array without allocating a new ResizeArray.

arr : 'T[]
Returns: ResizeArray<'T>

count arr

Full Usage: count arr

Parameters:
    arr : 'T[]

Returns: int
Modifiers: inline
Type parameters: 'T

Return the length or count of the collection. Same as Array.length

arr : 'T[]
Returns: int

countIf predicate arr

Full Usage: countIf predicate arr

Parameters:
    predicate : 'T -> bool
    arr : 'T[]

Returns: int
Modifiers: inline
Type parameters: 'T

Counts for how many items of the collection the predicate returns true. Same as Array.filter and then Array.length

predicate : 'T -> bool
arr : 'T[]
Returns: int

duplicates arr

Full Usage: duplicates arr

Parameters:
    arr : 'T[]

Returns: 'T[]

Returns all elements that exists more than once in Array. Each element that exists more than once is only returned once. Returned order is by first occurrence of first duplicate.

arr : 'T[]
Returns: 'T[]

duplicatesBy f arr

Full Usage: duplicatesBy f arr

Parameters:
    f : 'T -> 'U
    arr : 'T[]

Returns: 'T[]

Returns all elements that exists more than once in Array. Each element that exists more than once is only returned once. Returned order is by first occurrence of first duplicate.

f : 'T -> 'U
arr : 'T[]
Returns: 'T[]

failIfEmpty errorMessage arr

Full Usage: failIfEmpty errorMessage arr

Parameters:
    errorMessage : string
    arr : 'T[]

Returns: 'T[]
Modifiers: inline
Type parameters: 'T

Raises an Exception if the Array is empty. (Useful for chaining) Returns the input Array

errorMessage : string
arr : 'T[]
Returns: 'T[]

failIfLessThan count errorMessage arr

Full Usage: failIfLessThan count errorMessage arr

Parameters:
    count : int
    errorMessage : string
    arr : 'T[]

Returns: 'T[]

Raises an Exception if the Array has less then count items. (Useful for chaining) Returns the input Array

count : int
errorMessage : string
arr : 'T[]
Returns: 'T[]

filteri predicate arr

Full Usage: filteri predicate arr

Parameters:
    predicate : int -> bool - The function to test the current index.
    arr : 'T[] - The input array.

Returns: 'T[] An array containing the elements for which the given predicate returns true.

Returns a new collection containing only the elements of the collection for which the given predicate run on the index returns true.

predicate : int -> bool

The function to test the current index.

arr : 'T[]

The input array.

Returns: 'T[]

An array containing the elements for which the given predicate returns true.

findArray searchFor fromIdx tillIdx searchIn

Full Usage: findArray searchFor fromIdx tillIdx searchIn

Parameters:
    searchFor : 'T[]
    fromIdx : int
    tillIdx : int
    searchIn : 'T[]

Returns: int

Find first index where searchFor array occurs in searchIn array. Give lower and upper bound index for search space. Returns index of first element or -1 if not found

searchFor : 'T[]
fromIdx : int
tillIdx : int
searchIn : 'T[]
Returns: int

findLastArray searchFor fromIdx tillIdx searchIn

Full Usage: findLastArray searchFor fromIdx tillIdx searchIn

Parameters:
    searchFor : 'T[]
    fromIdx : int
    tillIdx : int
    searchIn : 'T[]

Returns: int

Find last index where searchFor array occurs in searchIn array. Searching from end. Give lower and upper bound index for search space. Returns index of first element or -1 if not found

searchFor : 'T[]
fromIdx : int
tillIdx : int
searchIn : 'T[]
Returns: int

findLastValue searchFor fromIdx tillIdx searchIn

Full Usage: findLastValue searchFor fromIdx tillIdx searchIn

Parameters:
    searchFor : 'T
    fromIdx : int
    tillIdx : int
    searchIn : 'T[]

Returns: int

Find last index where searchFor occurs in searchIn array. Searching from end. Give lower and upper bound index for search space. Returns -1 if not found

searchFor : 'T
fromIdx : int
tillIdx : int
searchIn : 'T[]
Returns: int

findValue searchFor fromIdx tillIdx searchIn

Full Usage: findValue searchFor fromIdx tillIdx searchIn

Parameters:
    searchFor : 'T
    fromIdx : int
    tillIdx : int
    searchIn : 'T[]

Returns: int

Find first index where searchFor occurs in searchIn array. Give lower and upper bound index for search space. Returns -1 if not found

searchFor : 'T
fromIdx : int
tillIdx : int
searchIn : 'T[]
Returns: int

first arr

Full Usage: first arr

Parameters:
    arr : 'T[]

Returns: 'T
Modifiers: inline
Type parameters: 'T

Gets the first item in the Array. Same as this.[0]

arr : 'T[]
Returns: 'T

firstAndOnly arr

Full Usage: firstAndOnly arr

Parameters:
    arr : 'T[]

Returns: 'T
Modifiers: inline
Type parameters: 'T

Gets the the only item in the Array. Fails if the Array does not have exactly one element.

arr : 'T[]
Returns: 'T

get arr index

Full Usage: get arr index

Parameters:
    arr : 'T[] - The input Array.
    index : int - The input index.

Returns: 'T The value of the Array at the given index.
Modifiers: inline
Type parameters: 'T

Gets an element from an Array. (Use Array.getNeg(i) function if you want to use negative indices too.)

arr : 'T[]

The input Array.

index : int

The input index.

Returns: 'T

The value of the Array at the given index.

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

getLooped index arr

Full Usage: getLooped index arr

Parameters:
    index : int
    arr : 'T[]

Returns: 'T
Modifiers: inline
Type parameters: 'T

Any index will return a value. Array is treated as an endless loop in positive and negative direction

index : int
arr : 'T[]
Returns: 'T

getNeg index arr

Full Usage: getNeg index arr

Parameters:
    index : int
    arr : 'T[]

Returns: 'T
Modifiers: inline
Type parameters: 'T

Gets an item in the Array by index. Allows for negative index too ( -1 is last item, like Python) (a negative index can also be done with '^' prefix. E.g. ^0 for the last item)

index : int
arr : 'T[]
Returns: 'T

hasItems count arr

Full Usage: hasItems count arr

Parameters:
    count : int
    arr : 'T[]

Returns: bool
Modifiers: inline
Type parameters: 'T

Returns true if the given Array has count items.

count : int
arr : 'T[]
Returns: bool

hasMaximumItems count arr

Full Usage: hasMaximumItems count arr

Parameters:
    count : int
    arr : 'T[]

Returns: bool
Modifiers: inline
Type parameters: 'T

Returns true if the given Array has equal or less than count items.

count : int
arr : 'T[]
Returns: bool

hasMinimumItems count arr

Full Usage: hasMinimumItems count arr

Parameters:
    count : int
    arr : 'T[]

Returns: bool
Modifiers: inline
Type parameters: 'T

Returns true if the given Array has equal or more than count items.

count : int
arr : 'T[]
Returns: bool

hasOne arr

Full Usage: hasOne arr

Parameters:
    arr : 'T[]

Returns: bool
Modifiers: inline
Type parameters: 'T

Returns true if the given Array has just one item. Same as Array.isSingleton

arr : 'T[]
Returns: bool

iPrevThisNext arr

Full Usage: iPrevThisNext arr

Parameters:
    arr : '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 Array.

arr : 'T[]
Returns: (int * 'T * 'T * 'T) seq

iThisNext arr

Full Usage: iThisNext arr

Parameters:
    arr : 'T[]

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

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

arr : 'T[]
Returns: (int * 'T * 'T) seq

isNotEmpty arr

Full Usage: isNotEmpty arr

Parameters:
    arr : 'T[]

Returns: bool
Modifiers: inline
Type parameters: 'T

Returns true if the given Array is not empty.

arr : 'T[]
Returns: bool

isSingleton arr

Full Usage: isSingleton arr

Parameters:
    arr : 'T[]

Returns: bool
Modifiers: inline
Type parameters: 'T

Returns true if the given Array has just one item. Same as Array.hasOne

arr : 'T[]
Returns: bool

mapIfInputAndResult inputPredicate resultPredicate transform arr

Full Usage: mapIfInputAndResult inputPredicate resultPredicate transform arr

Parameters:
    inputPredicate : 'T[] -> bool
    resultPredicate : 'T[] -> bool
    transform : 'T[] -> 'T[]
    arr : 'T[]

Returns: 'T[]
Modifiers: inline
Type parameters: 'T

Applies a function to array if it meets the inputPredicate, otherwise just returns input. If resulting array meets the resultPredicate it is returned, otherwise original input is returned.

inputPredicate : 'T[] -> bool
resultPredicate : 'T[] -> bool
transform : 'T[] -> 'T[]
arr : 'T[]
Returns: 'T[]

mapIfResult resultPredicate transform arr

Full Usage: mapIfResult resultPredicate transform arr

Parameters:
    resultPredicate : 'T[] -> bool
    transform : 'T[] -> 'T[]
    arr : 'T[]

Returns: 'T[]
Modifiers: inline
Type parameters: 'T

Applies a function to array If resulting array meets the resultPredicate it is returned, otherwise the original input is returned.

resultPredicate : 'T[] -> bool
transform : 'T[] -> 'T[]
arr : 'T[]
Returns: 'T[]

matches searchFor atIdx searchIn

Full Usage: matches searchFor atIdx searchIn

Parameters:
    searchFor : 'T[]
    atIdx : int
    searchIn : 'T[]

Returns: bool

Checks if a given array matches the content in Array at a given index

searchFor : 'T[]
atIdx : int
searchIn : 'T[]
Returns: bool

max2 arr

Full Usage: max2 arr

Parameters:
    arr : 'a[]

Returns: 'a * 'a
Modifiers: inline
Type parameters: 'a

Returns the biggest and the second biggest element of the Array. If they are equal then the order is kept

arr : 'a[]
Returns: 'a * 'a

max2By f arr

Full Usage: max2By f arr

Parameters:
    f : 'a -> 'b
    arr : 'a[]

Returns: 'a * 'a
Modifiers: inline
Type parameters: 'a, 'b

Returns the biggest and the second biggest element of the Array. Elements are compared by applying the predicate function first. If they are equal after function is applied then the order is kept

f : 'a -> 'b
arr : 'a[]
Returns: 'a * 'a

max2IndicesBy f arr

Full Usage: max2IndicesBy f arr

Parameters:
    f : 'a -> 'b
    arr : 'a[]

Returns: int * int
Modifiers: inline
Type parameters: 'a, 'b

Returns the indices of the biggest and the second biggest element of the Array. Elements are compared by applying the predicate function first. If they are equal after function is applied then the order is kept

f : 'a -> 'b
arr : 'a[]
Returns: int * int

max3 arr

Full Usage: max3 arr

Parameters:
    arr : 'a[]

Returns: 'a * 'a * 'a
Modifiers: inline
Type parameters: 'a

Returns the biggest three elements of the Array. The first element is the biggest, the second is the second biggest and the third is the third biggest. If they are equal then the order is kept

arr : 'a[]
Returns: 'a * 'a * 'a

max3By f arr

Full Usage: max3By f arr

Parameters:
    f : 'a -> 'b
    arr : 'a[]

Returns: 'a * 'a * 'a
Modifiers: inline
Type parameters: 'a, 'b

Returns the biggest three elements of the Array. The first element is the biggest, the second is the second biggest and the third is the third biggest. Elements are compared by applying the predicate function first. If they are equal after function is applied then the order is kept

f : 'a -> 'b
arr : 'a[]
Returns: 'a * 'a * 'a

max3IndicesBy f arr

Full Usage: max3IndicesBy f arr

Parameters:
    f : 'a -> 'b
    arr : 'a[]

Returns: int * int * int
Modifiers: inline
Type parameters: 'a, 'b

Returns the indices of the three biggest elements of the Array. The first element is the index of the biggest, the second is the index of the second biggest and the third is the index of the third biggest. Elements are compared by applying the predicate function first. If they are equal after function is applied then the order is kept

f : 'a -> 'b
arr : 'a[]
Returns: int * int * int

maxIndexBy projection arr

Full Usage: maxIndexBy projection arr

Parameters:
    projection : 'T -> 'Key - The function to transform the elements into a type supporting comparison.
    arr : 'T[] - The input Array.

Returns: int The index of the maximum element.
Modifiers: inline
Type parameters: 'T, 'Key

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

projection : 'T -> 'Key

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

arr : 'T[]

The input Array.

Returns: int

The index of the maximum element.

IndexOutOfRangeException Thrown when the input Array is empty.

min2 arr

Full Usage: min2 arr

Parameters:
    arr : 'a[]

Returns: 'a * 'a
Modifiers: inline
Type parameters: 'a

Returns the smallest and the second smallest element of the Array. If they are equal then the order is kept

arr : 'a[]
Returns: 'a * 'a

min2By f arr

Full Usage: min2By f arr

Parameters:
    f : 'a -> 'b
    arr : 'a[]

Returns: 'a * 'a
Modifiers: inline
Type parameters: 'a, 'b

Returns the smallest and the second smallest element of the Array. Elements are compared by applying the predicate function first. If they are equal after function is applied then the order is kept

f : 'a -> 'b
arr : 'a[]
Returns: 'a * 'a

min2IndicesBy f arr

Full Usage: min2IndicesBy f arr

Parameters:
    f : 'a -> 'b
    arr : 'a[]

Returns: int * int
Modifiers: inline
Type parameters: 'a, 'b

Returns the indices of the smallest and the second smallest element of the Array. Elements are compared by applying the predicate function first. If they are equal after function is applied then the order is kept

f : 'a -> 'b
arr : 'a[]
Returns: int * int

min3 arr

Full Usage: min3 arr

Parameters:
    arr : 'a[]

Returns: 'a * 'a * 'a
Modifiers: inline
Type parameters: 'a

Returns the smallest three elements of the Array. The first element is the smallest, the second is the second smallest and the third is the third smallest. If they are equal then the order is kept

arr : 'a[]
Returns: 'a * 'a * 'a

min3By f arr

Full Usage: min3By f arr

Parameters:
    f : 'a -> 'b
    arr : 'a[]

Returns: 'a * 'a * 'a
Modifiers: inline
Type parameters: 'a, 'b

Returns the smallest three elements of the Array. The first element is the smallest, the second is the second smallest and the third is the third smallest. Elements are compared by applying the predicate function first. If they are equal after function is applied then the order is kept

f : 'a -> 'b
arr : 'a[]
Returns: 'a * 'a * 'a

min3IndicesBy f arr

Full Usage: min3IndicesBy f arr

Parameters:
    f : 'a -> 'b
    arr : 'a[]

Returns: int * int * int
Modifiers: inline
Type parameters: 'a, 'b

Returns the indices of the three smallest elements of the Array. The first element is the index of the smallest, the second is the index of the second smallest and the third is the index of the third smallest. Elements are compared by applying the predicate function first. If they are equal after function is applied then the order is kept

f : 'a -> 'b
arr : 'a[]
Returns: int * int * int

minIndexBy projection arr

Full Usage: minIndexBy projection arr

Parameters:
    projection : 'T -> 'Key - The function to transform the elements into a type supporting comparison.
    arr : 'T[] - The input Array.

Returns: int The index of the smallest element.
Modifiers: inline
Type parameters: 'T, 'Key

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

projection : 'T -> 'Key

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

arr : 'T[]

The input Array.

Returns: int

The index of the smallest element.

IndexOutOfRangeException Thrown when the input Array is empty.

ofIList arr

Full Usage: ofIList arr

Parameters:
Returns: 'T[]
Modifiers: inline
Type parameters: 'T

Build a Array from the given IList Interface.

arr : IList<'T>
Returns: 'T[]

ofResizeArray rarr

Full Usage: ofResizeArray rarr

Parameters:
    rarr : ResizeArray<'T>

Returns: 'T[]
Modifiers: inline
Type parameters: 'T

Builds a new Array from the given ResizeArray. (Use the asArray function if you want to just cast an ResizeArray to a Array in Fable-JavaScript)

rarr : ResizeArray<'T>
Returns: 'T[]

prevThis arr

Full Usage: prevThis arr

Parameters:
    arr : 'T[]

Returns: ('T * 'T) seq

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

arr : 'T[]
Returns: ('T * 'T) seq

prevThisNext arr

Full Usage: prevThisNext arr

Parameters:
    arr : 'T[]

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

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

arr : 'T[]
Returns: ('T * 'T * 'T) seq

rotate amount arr

Full Usage: rotate amount arr

Parameters:
    amount : int - How many elements to shift forward. Or backward if number is negative
    arr : 'T[] - The input Array.

Returns: 'T[] The new result Array.
Modifiers: inline
Type parameters: 'T

Considers array circular and move elements up for positive integers or down for negative integers. e.g.: rotate +1 [ a, b, c, d] = [ d, a, b, c] e.g.: rotate -1 [ a, b, c, d] = [ b, c, d, a] the amount can even be bigger than the array's size. I will just rotate more than one loop.

amount : int

How many elements to shift forward. Or backward if number is negative

arr : 'T[]

The input Array.

Returns: 'T[]

The new result Array.

rotateDownTill condition arr

Full Usage: rotateDownTill condition arr

Parameters:
    condition : 'T -> bool - The condition to meet.
    arr : 'T[] - The input Array.

Returns: 'T[] The new result Array.
Modifiers: inline
Type parameters: 'T

Considers array circular and move elements down till condition is met for the first item. The algorithm takes elements from the start and put them at the end till the first element in the array meets the condition. If the first element in the input meets the condition no changes are made. But still a shallow copy is returned.

condition : 'T -> bool

The condition to meet.

arr : 'T[]

The input Array.

Returns: 'T[]

The new result Array.

rotateDownTillLast condition arr

Full Usage: rotateDownTillLast condition arr

Parameters:
    condition : 'T -> bool - The condition to meet.
    arr : 'T[] - The input Array.

Returns: 'T[] The new result Array.
Modifiers: inline
Type parameters: 'T

Considers array circular and move elements down till condition is met for the last item. The algorithm takes elements from the start and put them at the end till the last element in the array meets the condition. If the last element in the input meets the condition no changes are made. But still a shallow copy is returned.

condition : 'T -> bool

The condition to meet.

arr : 'T[]

The input Array.

Returns: 'T[]

The new result Array.

rotateUpTill condition arr

Full Usage: rotateUpTill condition arr

Parameters:
    condition : 'T -> bool - The condition to meet.
    arr : 'T[] - The input Array.

Returns: 'T[] The new result Array.
Modifiers: inline
Type parameters: 'T

Considers array circular and move elements up till condition is met for the first item. The algorithm takes elements from the end and put them at the start till the first element in the array meets the condition. If the first element in the input meets the condition no changes are made. But still a shallow copy is returned.

condition : 'T -> bool

The condition to meet.

arr : 'T[]

The input Array.

Returns: 'T[]

The new result Array.

rotateUpTillLast condition arr

Full Usage: rotateUpTillLast condition arr

Parameters:
    condition : 'T -> bool - The condition to meet.
    arr : 'T[] - The input Array.

Returns: 'T[] The new result Array.
Modifiers: inline
Type parameters: 'T

Considers array circular and move elements up till condition is met for the last item. The algorithm takes elements from the end and put them at the start till the last element in the array meets the condition. If the last element in the input meets the condition no changes are made. But still a shallow copy is returned.

condition : 'T -> bool

The condition to meet.

arr : 'T[]

The input Array.

Returns: 'T[]

The new result Array.

second arr

Full Usage: second arr

Parameters:
    arr : 'T[]

Returns: 'T
Modifiers: inline
Type parameters: 'T

Gets the second item in the Array. Same as this.[1]

arr : 'T[]
Returns: 'T

secondLast arr

Full Usage: secondLast arr

Parameters:
    arr : 'T[]

Returns: 'T
Modifiers: inline
Type parameters: 'T

Gets the second last item in the Array. Same as this.[this.Length - 2]

arr : 'T[]
Returns: 'T

set arr index value

Full Usage: set arr index value

Parameters:
    arr : 'T[] - The input Array.
    index : int - The input index.
    value : 'T - The input value.

Modifiers: inline
Type parameters: 'T

Sets an element of a Array. (use Array.setNeg(i) function if you want to use negative indices too)

arr : 'T[]

The input Array.

index : int

The input index.

value : 'T

The input value.

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

setLooped index value arr

Full Usage: setLooped index value arr

Parameters:
    index : int
    value : 'T
    arr : 'T[]

Modifiers: inline
Type parameters: 'T

Any index will set a value. Array is treated as an endless loop in positive and negative direction

index : int
value : 'T
arr : 'T[]

setNeg index value arr

Full Usage: setNeg index value arr

Parameters:
    index : int
    value : 'T
    arr : 'T[]

Modifiers: inline
Type parameters: 'T

Sets an item in the Array by index. Allows for negative index too ( -1 is last item, like Python) (a negative index can also be done with '^' prefix. E.g. ^0 for the last item)

index : int
value : 'T
arr : 'T[]

singleton value

Full Usage: singleton value

Parameters:
    value : 'a - The input item.

Returns: 'a[] The result Array of one item.
Modifiers: inline
Type parameters: 'a

Returns a Array that contains one item only.

value : 'a

The input item.

Returns: 'a[]

The result Array of one item.

slice startIdx endIdx arr

Full Usage: slice startIdx endIdx arr

Parameters:
    startIdx : int
    endIdx : int
    arr : 'T[]

Returns: 'T[]

Slice the Array given start and end index. Allows for negative indices too. ( -1 is last item, like Python) The resulting Array includes the end index. Raises an IndexOutOfRangeException if indices are out of range. If you don't want an exception to be raised for index overflow or overlap use Array.trim. (A negative index can also be done with '^' prefix. E.g. ^0 for the last item, when F# Language preview features are enabled.)

startIdx : int
endIdx : int
arr : 'T[]
Returns: 'T[]

swap i j arr

Full Usage: swap i j arr

Parameters:
    i : int
    j : int
    arr : 'T[]

Modifiers: inline
Type parameters: 'T

Swap the values of two given indices in Array

i : int
j : int
arr : 'T[]

third arr

Full Usage: third arr

Parameters:
    arr : 'T[]

Returns: 'T
Modifiers: inline
Type parameters: 'T

Gets the third item in the Array. Same as this.[2]

arr : 'T[]
Returns: 'T

thirdLast arr

Full Usage: thirdLast arr

Parameters:
    arr : 'T[]

Returns: 'T
Modifiers: inline
Type parameters: 'T

Gets the third last item in the Array. Same as this.[this.Length - 3]

arr : 'T[]
Returns: 'T

thisNext arr

Full Usage: thisNext arr

Parameters:
    arr : '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 Array.

arr : 'T[]
Returns: ('T * 'T) seq

toResizeArray arr

Full Usage: toResizeArray arr

Parameters:
    arr : 'T[]

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

Return a fixed-length Array containing the elements of the input Array as a copy. This function always allocates a new ResizeArray and copies the elements. (Use the asArray function if you want to just cast a Array to an Array in Fable-JavaScript)

arr : 'T[]
Returns: ResizeArray<'T>

trim fromStartCount fromEndCount arr

Full Usage: trim fromStartCount fromEndCount arr

Parameters:
    fromStartCount : int
    fromEndCount : int
    arr : 'T[]

Returns: 'T[]

Trim items from start and end. If the sum of fromStartCount and fromEndCount is bigger than arr.Length it returns an empty Array. If you want an exception to be raised for index overlap (total trimming is bigger than count) use Array.slice with negative end index.

fromStartCount : int
fromEndCount : int
arr : 'T[]
Returns: 'T[]

windowed2 arr

Full Usage: windowed2 arr

Parameters:
    arr : 'T[]

Returns: ('T * 'T) seq

Yields Seq from (first, second) up to (second-last, last). Not looped. The resulting seq is one element shorter than the input Array.

arr : 'T[]
Returns: ('T * 'T) seq

windowed2i arr

Full Usage: windowed2i arr

Parameters:
    arr : 'T[]

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

Yields Seq from (0,first, second) up to (lastIndex-1 , second-last, last). Not looped. The resulting seq is one element shorter than the input Array.

arr : 'T[]
Returns: (int * 'T * 'T) seq

windowed3 arr

Full Usage: windowed3 arr

Parameters:
    arr : 'T[]

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

Yields Seq from (first, second, third) up to (third-last, second-last, last). Not looped. The resulting seq is two elements shorter than the input Array.

arr : 'T[]
Returns: ('T * 'T * 'T) seq

windowed3i arr

Full Usage: windowed3i arr

Parameters:
    arr : 'T[]

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

Yields Seq from (1, first, second, third) up to (lastIndex-1 , third-last, second-last, last). Not looped. The resulting seq is two elements shorter than the input Array.

arr : 'T[]
Returns: (int * 'T * 'T * 'T) seq

Type something to start searching.