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

(HK 
type
:
Type, V 
type
:
Type, ks array HK, vs array V)
:
Map HK, V
 is
[Contains abstract features]
[Module base]
hash_map -- an immutable hash map from keys HK to values V
(K 
type
:
Type, V 
type
:
Type)
 ref
:
Any
 is
[Contains abstract features]
[Module base]
Map -- an abstract map from keys K to values V
(OK 
type
:
Type, V 
type
:
Type, k0 Sequence OK, v0 Sequence V)
:
Map OK, V
 is
[Module base]
ordered_map -- an immutable map from ordered keys OK to values V

Lookup performance is O(log size) since it uses binary search in a
sorted array. When deterministic performance is desired, an ordered map
should be preferred over a hash map.

performance of creation of the map is in O(n log n) where n is
keys.length.
(K 
type
:
Type, V 
type
:
Type)
 ref
:
Map K, V
 is
[Contains abstract features]
[Module base]
Persistent_Map -- an abstract persistent map from keys K to values V
(PK 
type
:
Type, V 
type
:
Type)
:
Map PK, V
 is
[Private constructor]
[Module base]
ps_map -- a partially sorted map

ps_map is a persistent map from an ordered key PK to a value V. This map is
generally well-behaved with respect to cumulative and average performance.

The keys and values are stored in arrays consisting of sorted sub-arrays,
with sub-arrays corresponding to the 1-bits in the binary representation
of the size.

This results in cumulative memory usage in O(size log² size), worst-case
lookup time in O(log² size) and average addition time in O(1) and worst-case
addition time in O(size log² size).

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_map is performance critical. If the resulting map'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.

This constructor is for internal use only, to create instance of ps_map, use
ps_map PK V without arguments.
0.095dev (2025-08-15 12:02:22 GIT hash 301b5b75e77076d091b38f555473f9f0e31e5b5c built by fridi@fzen)