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
)
 ref
:
Sequence T
 is
  
[Contains abstract features]
 
[Module base]
abstract type for 'Linked_List'
§
(LM 
type
, T 
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
)
:
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
)
 ref
:
Sequence E
 is
  
[Contains abstract features]
 
[Module base]
Set -- an abstract set of values
§
(T 
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).

Functions

set_of_hashable -- routine to initialize a set from a Sequence of hashable elements

This feature creates an instance of a Set.