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

container

container

:
Any
 is
[Module base]
container -- unit feature to group features that provide some kind of
data structure to store and retrieve values

Constructors

(T 
type
:
Type)
:
Sequence T
 is
[Contains abstract features]
[Module base]
abstract_array -- parent of array implementation like `array` and `expanding_array`

This provides basic functionality that an array should provide based on `index[i]`
and `length` that have to be provided by children of `abstract_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.
(T 
type
:
Type)
 ref
:
Sequence T
 is
[Contains abstract features]
[Module base]
abstract type for 'Linked_List'
(LM 
type
:
Type, T 
type
:
Type)
 ref
:
Linked_List T
 is
[Private constructor]
[Module base]
a type for mutable singly linked lists

On call to `Mutable_Linked_List LM T data` creates a minimal list consisting
of only one single element. To create larger rings, you can either call
`append` to add single cells, or `concat` to concatenate two lists.
(K 
type
:
Type)
:
Set K
 is
[Private constructor]
[Module base]
ps_set -- a partially sorted set based on ps_map

ps_set is a persistent set of ordered values. This set is generally
well-behaved with respect to cumulative and average performance.

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 ps_set is performance critical. If the resulting set's size n is a
power of 2, this will trigger the worst-case addition time resulting in
O(m*n log² n) for adding an element m times.
(E 
type
:
Type)
 ref
:
Sequence E,equatable
 is
[Contains abstract features]
[Module base]
Set -- an abstract set of values
set_of_hashable -- routine to initialize a set from a Sequence of hashable elements

This feature creates an instance of a Set.
(T 
type
:
Type, from Sequence T, less_or_equal Binary bool T T)
:
array T
 is
[Module base]
sorted_array -- sorted one-dimensional immutable array

This takes an unsorted array and a compare function as an arguments and
returns a sorted one.

Non-mutating heap sort is used internally. This gives guaranteed performance in
O(n log n) comparisons and assignments for an array of size n.

This is a little wasteful on allocated memory, which is also O(n log n) since
partially sorted arrays are thrown away. This might be improved to use an
in-place heap sort to bring allocated memory down to O(n).
 ref
:
Sequence container.Typed_Value
 is
[Contains abstract features]
[Module base]
Typed_Sequence -- ancestor for features representing sequence of typed values

Unlike `Sequence`, which contains values of all the same type, a `Typed_Sequence`
contains values of different types. This is similar to `Sequence Any`, only that
values are not forced to be boxed into references.

Actual implementations of this must provide an implementation of abstract feature
`typed_foldf`.

The desired way to use this feature is via calls to `typed_foldf` since this will
avoid the creation of boxed `Typed_Value` instances.

`Typed_Sequence` inherits from `Sequence Typed_Value` such that all the power of
`Sequence` is available here, but at the cost of boxing into `Typed_Value`
references values.
0.095dev (2025-08-15 12:02:22 GIT hash 301b5b75e77076d091b38f555473f9f0e31e5b5c built by fridi@fzen)