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

tokiwa

API-Documentation: module tokiwa

Constructors

(T 
type
)
:
abstract_array T
 is
[Private constructor]
[Module base]
array -- one-dimensional immutable array

This is the result type of array(type, i32, i32 -> T) which creates an
initialized immutable array

Note: This uses dummy unit-type args to avoid
name clash with routine array(T,length,init).
(val u32)
:
String
 is
[Module base]
codepoint -- represents a unicode codepoint
:
Any
 is
[Unit Type]
[Module base]
container -- unit feature to group features that provide some kind of
data structure to store and retrieve values
:
Types
 is
[Unit Type]
[Module base]
effect_types provides access to all effect types that are used by the
current application.
:
Any
 is
[Unit Type]
[Module base]
envir -- unit feature to group environment related features
:
Any
 is
[Unit Type]
[Module base]
fuzion -- unit feature to group fuzion-infrastructure related features
(T 
type
:
integer, from T, through option T, step T)
:
Set T
 is
[Module base]
A `from..through` interval with a given `step`.

This is a `Set T` and a `Sequence T` created by repeatedly adding `step` to `from`.
Stops before passing `through` (exceeding it for `step > 0`, falling below for `step < 0`).

Empty if `step` points away from `through`:
interval 1 2 -1 # empty: steps down, but through is up
interval 2 1 1 # empty: steps up, but through is down


A zero `step` is only allowed when `from = through`; such an interval
contains the single element `from`:
interval 5 5 0 # 5

If `through` is `nil`, the interval is unbounded and limited only by type `T` range.

This is not an interval in the mathematical sense, but rather a representation
of an arithmetic progression.
:
Any
 is
[Unit Type]
[Module lock_free]
lock_free -- unit type feature grouping lock-free
data structures and algorithms
:
Any
 is
[Unit Type]
[Module nom]
nom is a parser combinator framework
for more information go to:
https://github.com/Geal/nom/
 ref
:
Types
 is
[Private constructor]
[Module base]
Open_Types -- parent feature of type used for open types

This is the parent feature of the result type of open type parameters
such as `choice..CHOICE_ELEMENT_TYPE`.

The Open_Types value inherits from `Types` permitting access to
the individual types.
(T 
type
)
 ref
:
countable,orderable,hashable
 is
[Contains abstract features]
[Module base]
Sequence -- ancestor for features that can be converted to a 'list'

Sequences are empty, finite or infinite ordered collections of instances
of a given type. Sequences may calculate elements lazily on demand.

Sequence is a 'ref' type, i.e., different sub-features may be assigned
to a field of type 'Sequence'.

Heirs of Sequence must implement 'as_list'.
 ref
:
hashable,orderable
 is
[Contains abstract features]
[Module base]
string -- immutable sequences of utf8 encoded unicode characters
:
Any
 is
[Unit Type]

unit feature grouping tokiwa related code
 ref
:
Typed_Sequence
 is
[Private constructor]
[Module base]
Values_Of_Open_Type -- parent feature of type used for open types

This is the parent feature of the result type of fields with open
type such as `tuple.values` if called without selecting a particular
variant such as `tuple.values.2`.

The Values_Of_Open_Type value inherits from `TypedSequence` permitting access to
the types and values of the individual fields

Choice Types

list -- feature used to define lists

list provides an abstract type for a sequence of elements of the same type.

A list sequence may be empty and contain no element, or it may have a fixed
or even an infinite number of elements.

The core of the implementation of an actual list lies in the implementation
of the actual Cons cell a non-empty list consists of.

Lists can typically be traversed using only immutable data. This makes them
more flexible than streams that require to store and update their state.

A list is immutable, so it can be reused and shared between threads.
Due to the nature of lists, in which many Cons cells are used, a list
may require more (heap) allocation than an array.

(T 
type
)
:
switch T, nil
[Contains abstract features]
[Module base]
option -- feature wrapping a value or nothing

option represents an optional value of type T
(T 
type
)
:
switch T, error
[Contains abstract features]
[Module base]
outcome -- result type for functions that may return an error

outcome is a choice type that represents the result of a routine that
may either produce something useful or fail producing an error condition.

Several error conditions are needed if there are several very different
reasons for an operation to fail, e.g.


Note that 'outcome data IO_Error' is not assignment compatible with
'outcome data IO_Error Permission_Error', it has to be unwrapped first.
This unwrapping, however, requires very little boilerplate, it is done
using the '?' on the result of the call to 'read_file': This unwraps
'outcome data IO_Error' into 'IO_Error', which would be returned abruptly,
and 'data', which would be returned normally. Both are assignment
compatible to 'outcome data IO_Error Permission_Error', so everything
is fine.
(A 
type
, B 
type
)
:
choice A, B,monad A,Sequence A,hashable,orderable
[Contains abstract features]
[Module base]
switch is the parent feature of all choices
that encode success and failure,
e.g. option (something/nil)
or outcome (something/error)
0.099dev (GIT hash 9b94ad4b4a4bff2bf2be7d77be2c6e1fd7683c4d)
last changed: 2026-09-23