Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

marray

marray

marray -- one-dimensional mutable array

NYI: marray should be rewritten using effects.
create a new marray by adding a new element o at the end of this marray
create immutable array from this

redefines:

create a list from this marray

redefines:

is this sequence known to be finite? For infinite sequences, features like
count diverge.

redefines:

§fold(i i32, s T, m Monoid marray.T)
 => 
T
:
Any 
fold the elements of this array using the given monoid and initial value

Used to fold an array tail-recursively
fold the elements of this array using the given monoid.

e.g., to sum the elements of an array of i32, use a.fold i32.sum

redefines:

get element at given index i
set element at given index i to given value o
a sequence of all valid indices to access this array. Useful e.g., for
`for`-loops:

for i in arr.indices do
infix operator synonym for add
map the array to a new array applying function f to all elements