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

expanding_array

container.expanding_array

(T 
type
:
Type)
:
abstract_array T
 is
[Private constructor]
[Module base]
expanding_array -- an array with a length and a (possible larger) capacity

An expanding array is a persistent data structure that has cumulative O(1)
performance of adding single elements at its end.

WARNING: Due to the high worst-case time for addition, this structure should
not be used in situations when adding a single element repeatedly to the same
instance of `expanding_array` is performance critical. If the resulting
`expanding_array`'s length is `l`, this will trigger the worst-case
addition time, resulting in cumulative time O(m*l) for adding an element m
times.

This constructor is for internal use only, to create instance of
`expanding_array`, use `(expanding_array T).type.empty` to create an empty
expanding array instance.

Type Parameters

T
[Module base]
element type

Fields

length
 i32
[Module base]
the length of the array

Functions

group the elements of this sequence by a key of type K

f determines the key of an element
0.095dev (2025-08-15 12:02:22 GIT hash 301b5b75e77076d091b38f555473f9f0e31e5b5c built by fridi@fzen)