Header menu logo ArrayT

UtilArray Module

Types

Type Description

DebugIndexer<'T>

A simple Wrapper for an array. The sole purpose is to provide a better Exception message when an index is out of range.

Functions and values

Function or value Description

badGetExn i arr funcName

Full Usage: badGetExn i arr funcName

Parameters:
    i : int
    arr : 'T[]
    funcName : string

Returns: 'a
i : int
arr : 'T[]
funcName : string
Returns: 'a

badSetExn i arr funcName doingSet

Full Usage: badSetExn i arr funcName doingSet

Parameters:
    i : int
    arr : 'T[]
    funcName : string
    doingSet : 'T

Returns: 'a
i : int
arr : 'T[]
funcName : string
doingSet : 'T
Returns: 'a

contentAsString entriesToPrint arr

Full Usage: contentAsString entriesToPrint arr

Parameters:
    entriesToPrint : int
    arr : 'T[]

Returns: string

Returns a string with the content of the array up to 'entriesToPrint' entries. Includes the index of each entry. Includes the last entry (prints one extra if only one more remains to avoid "...").

entriesToPrint : int
arr : 'T[]
Returns: string

fail arr funcAndReason

Full Usage: fail arr funcAndReason

Parameters:
    arr : 'T[]
    funcAndReason : string

Returns: 'a
arr : 'T[]
funcAndReason : string
Returns: 'a

getUnCkd i arr

Full Usage: getUnCkd i arr

Parameters:
    i : int
    arr : 'T[]

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

Gets the value at index i, skipping bounds check in compiled JS code.

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

negIdx i len

Full Usage: negIdx i len

Parameters:
    i : int
    len : int

Returns: int
Modifiers: inline

Converts negative indices to positive ones. Correct results from -length up to length-1. e.g.: -1 is last item. (from the release of F# 5 on a negative index can also be done with '^' prefix. E.g. ^0 for the last item)

i : int
len : int
Returns: int

negIdxLooped i length

Full Usage: negIdxLooped i length

Parameters:
    i : int
    length : int

Returns: int
Modifiers: inline

Any int will give a valid index for given collection size. Converts negative indices to positive ones and loops to start after last index is reached. Returns a valid index for a collection of 'length' items for any integer. Requires length > 0.

i : int
length : int
Returns: int

nullExn funcName

Full Usage: nullExn funcName

Parameters:
    funcName : string

Returns: 'a
funcName : string
Returns: 'a

setUnCkd i v arr

Full Usage: setUnCkd i v arr

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

Modifiers: inline
Type parameters: 'T

Sets the value at index i, skipping bounds check in compiled JS code.

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

toStringCore ofType arr

Full Usage: toStringCore ofType arr

Parameters:
    ofType : 'a
    arr : 'T[]

Returns: string
Modifiers: inline
Type parameters: 'a, 'T
ofType : 'a
arr : 'T[]
Returns: string

toStringInline arr

Full Usage: toStringInline arr

Parameters:
    arr : 'T[]

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

Type something to start searching.