Array2D
Array2D
empty
identity
repeat
init
initWithList
initWithLists
fromList
fromLists
fromExactList
fromExactLists
shape
size
hasIndex
isEmpty
set
get
update
replace
swap
map
mapWithIndex
walk
walkUntil
first
last
firstIndex
lastIndex
toList
toLists
reshape
transpose
flipRows
flipCols
rotateClockwise
rotateCounterClockwise
countIf
findFirstIndex
findLastIndex
joinWith
subarray
mul
Index2D
Index2D
add
sub
incRow
incCol
decRow
decCol
adjacentTo
allAdjacentTo
flipRow
flipCol
transpose
first
last
isRowStart
isColStart
isRowEnd
isColEnd
Shape2D
Shape2D
isEmpty
hasIndex
size
Return to Roc packages
Documentation
(press
s
)
Array2D
.
Array2D
Array2D
.
empty
: {} -> Array2D *
Array2D
.
identity
: U64 -> Array2D (Num *)
Array2D
.
repeat
: a, Shape2D -> Array2D a
Array2D
.
init
: Shape2D, (Index2D -> a) -> Array2D a
Array2D
.
initWithList
: List a, Shape2D, (Result a [Empty], Index2D -> b) -> Array2D b
Array2D
.
initWithLists
: List (List a), Shape2D, (Result a [Empty], Index2D -> b) -> Array2D b
Array2D
.
fromList
: List a, [ Fit, Fill a Shape2D ] -> Array2D a
Array2D
.
fromLists
: List (List a), [ FitShortest, FitLongest a, Fill a Shape2D ] -> Array2D a
Array2D
.
fromExactList
: List a, Shape2D -> Result (Array2D a) [ NotEnoughElements, TooManyElements ]
Array2D
.
fromExactLists
: List (List a) -> Result (Array2D a) [InconsistentRowLengths]
Array2D
.
shape
: Array2D * -> Shape2D
Array2D
.
size
: Array2D * -> U64
Array2D
.
hasIndex
: Array2D *, Index2D -> Bool
Array2D
.
isEmpty
: Array2D * -> Bool
Array2D
.
set
: Array2D a, Index2D, a -> Array2D a
Array2D
.
get
: Array2D a, Index2D -> Result a [OutOfBounds]
Array2D
.
update
: Array2D a, Index2D, (a -> a) -> Array2D a
Array2D
.
replace
: Array2D a, Index2D, a -> { array : Array2D a, value : a }
Array2D
.
swap
: Array2D a, Index2D, Index2D -> Array2D a
Array2D
.
map
: Array2D a, (a -> b) -> Array2D b
Array2D
.
mapWithIndex
: Array2D a, (a, Index2D -> b) -> Array2D b
Array2D
.
walk
: Array2D a, state, WalkOptions *, (state, a, Index2D -> state) -> state
Array2D
.
walkUntil
: Array2D a, state, WalkOptions *, (state, a, Index2D -> [ Continue state, Break state ]) -> state
Array2D
.
first
: Array2D a -> Result a [ArrayWasEmpty]
Array2D
.
last
: Array2D a -> Result a [ArrayWasEmpty]
Array2D
.
firstIndex
: Array2D * -> Result Index2D [ArrayWasEmpty]
Array2D
.
lastIndex
: Array2D * -> Result Index2D [ArrayWasEmpty]
Array2D
.
toList
: Array2D a -> List a
Array2D
.
toLists
: Array2D a -> List (List a)
Array2D
.
reshape
: Array2D a, a, Shape2D -> Array2D a
Array2D
.
transpose
: Array2D a -> Array2D a
Array2D
.
flipRows
: Array2D a -> Array2D a
Array2D
.
flipCols
: Array2D a -> Array2D a
Array2D
.
rotateClockwise
: Array2D a -> Array2D a
Array2D
.
rotateCounterClockwise
: Array2D a -> Array2D a
Array2D
.
countIf
: Array2D a, (a -> Bool) -> U64
Array2D
.
findFirstIndex
: Array2D a, (a -> Bool) -> Result Index2D [NotFound]
Array2D
.
findLastIndex
: Array2D a, (a -> Bool) -> Result Index2D [NotFound]
Array2D
.
joinWith
: Array2D Str, Str, Str -> Str
Array2D
.
subarray
: Array2D a, Index2D, Index2D -> Array2D a
Array2D
.
mul
: Array2D (Num a), Array2D (Num a) -> Result (Array2D (Num a)) [InnerDimensionsMismatch]
Index2D
.
Index2D
Index2D
.
add
: Index2D, Index2D, Shape2D -> Result Index2D [OutOfBounds]
Index2D
.
sub
: Index2D, Index2D, Shape2D -> Result Index2D [OutOfBounds]
Index2D
.
incRow
: Index2D, Shape2D -> Result Index2D [OutOfBounds]
Index2D
.
incCol
: Index2D, Shape2D -> Result Index2D [OutOfBounds]
Index2D
.
decRow
: Index2D, Shape2D -> Result Index2D [OutOfBounds]
Index2D
.
decCol
: Index2D, Shape2D -> Result Index2D [OutOfBounds]
Index2D
.
adjacentTo
: Index2D, Shape2D, [ PrevRow, SameRow, NextRow ], [ PrevCol, SameCol, NextCol ] -> Result Index2D [OutOfBounds]
Index2D
.
allAdjacentTo
: Index2D, Shape2D -> List Index2D
Index2D
.
flipRow
: Index2D, Shape2D -> Result Index2D [OutOfBounds]
Index2D
.
flipCol
: Index2D, Shape2D -> Result Index2D [OutOfBounds]
Index2D
.
transpose
: Index2D -> Index2D
Index2D
.
first
: Shape2D -> Result Index2D [ShapeWasEmpty]
Index2D
.
last
: Shape2D -> Result Index2D [ShapeWasEmpty]
Index2D
.
isRowStart
: Index2D -> Bool
Index2D
.
isColStart
: Index2D -> Bool
Index2D
.
isRowEnd
: Index2D, Shape2D -> Bool
Index2D
.
isColEnd
: Index2D, Shape2D -> Bool
Shape2D
.
Shape2D
Shape2D
.
isEmpty
: Shape2D -> Bool
Shape2D
.
hasIndex
: Shape2D, Index2D -> Bool
Shape2D
.
size
: Shape2D -> U64
Exposed Modules
LLM docs
Array2D
Index2D
Shape2D