The unit type ()
is inhabited by just a single value, namely ()
.
See also the voidstd/core/types/void: V
type and the boolstd/core/types/bool: V
type.
A pair of values a
and b
.
A triple of values.
Automatically generated. Retrieves the fst
constructor field of the (,,)
type.
Automatically generated. Retrieves the snd
constructor field of the (,,)
type.
Automatically generated. Retrieves the thd
constructor field of the (,,)
type.
A quadruple of values.
Automatically generated. Retrieves the field4
constructor field of the (,,,)
type.
Automatically generated. Retrieves the fst
constructor field of the (,,,)
type.
Automatically generated. Retrieves the snd
constructor field of the (,,,)
type.
Automatically generated. Retrieves the thd
constructor field of the (,,,)
type.
A quintuple of values.
Automatically generated. Retrieves the field4
constructor field of the (,,,,)
type.
Automatically generated. Retrieves the field5std/core/types/field5: forall<a,b,c,d,a1> ((a, b, c, d, a1)) -> a1
constructor field of the (,,,,)
type.
Automatically generated. Retrieves the fst
constructor field of the (,,,,)
type.
Automatically generated. Retrieves the snd
constructor field of the (,,,,)
type.
Automatically generated. Retrieves the thd
constructor field of the (,,,,)
type.
The total effect represents the absence of any effect.
The effect constructor extends an effect with another effect.
The alloc effect signifies a function may allocate in a heap h
.
An any type. Used for extern calls.
The type of booleans has two inhabitants: Truestd/core/types/True: bool
and Falsestd/core/types/False: bool
.
Logical negation.
Logical conjuction.
Logical disjunction.
Automatically generated. Tests for the Falsestd/core/types/False: bool
constructor of the boolstd/core/types/bool: V
type.
Automatically generated. Tests for the Truestd/core/types/True: bool
constructor of the boolstd/core/types/bool: V
type.
Logical negation.
Explicitly box values using the Boxstd/core/types/Box: forall<a> (unbox : a) -> box<a>
constructor.
Automatically generated. Retrieves the unboxstd/core/types/unbox: forall<a> (box : box<a>) -> a
constructor field of the boxstd/core/types/box: V -> V
type.
Internal. Internal type for tail recursion module cons (TRMC) optimization.
Holds the address to a field of type a
in a constructor.
A unicode character.
Characters are unicode codepoints.
This is different from a unicode grapheme which represents a single displayed
symbol and can consists of multiple codepoints due to combining characters and marks.
(see also the std/text/unicode
module).
Internal. Internal type for tail recursion module cons (TRMC) optimization.
The divergence effect: a divergent function may not terminate.
The predicate edivstd/core/types/ediv: (X, V, E) -> P<x,a,e>
signifies that if the type a
contains a reference to effect constant x
then the effect e
must contain the divergent effect (divstd/core/types/div: X
). This constraint is generated
for operations on first-class effects where code can diverge through operations.
The choice type represents one of two possible types a
or b
.
Automatically generated. Tests for the Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b>
constructor of the eitherstd/core/types/either: (V, V) -> V
type.
Automatically generated. Tests for the Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>
constructor of the eitherstd/core/types/either: (V, V) -> V
type.
A 32-bit IEEE 754 single precision floating point value. Provides currently no operations and currently only used for storage and for interaction with external code.
A 64-bit IEEE 754 double precision floating point value.
See also std/num/float64
for more operations on float64std/core/types/float64: V
s.
The globalstd/core/types/global: H
heap is a special heap constant to denote the global shared heap.
Handled effects are lifted to an atomic effect using the handledstd/core/types/handled: HX -> X
type constructor.
Linear effects are lifted to an atomic effect using the handled1std/core/types/handled1: HX1 -> X
type constructor.
Explicitly heap allocate using the Hbox
constructor.
Automatically generated. Retrieves the unhboxstd/core/types/unhbox: forall<a> (hbox : hbox<a>) -> a
constructor field of the hboxstd/core/types/hbox: V -> V
type.
The predicate hdivstd/core/types/hdiv: (H, V, E) -> P<h,a,e>
signifies that if the type a
contains a reference to h
,
then the effect e
must contain the divergent effect (divstd/core/types/div: X
). This constraint is generated
when reading from the heap (see !
) and is necessary to catch cases where code can diverge
by storing self referential functions in the heap.
An arbitrary precision signed integer.
A 16-bit signed integer (represented in two's complement). Provides no operations and used only for storage and interaction with external code.
A 32-bit signed integer (represented in two's complement).
See the std/num/int32
module for operations on 32-bit integers.
Internal: 32-bit zero, needed for markers in std/core/hnd
.
A 64-bit signed integer (represented in two's complement).
See the std/num/int64
module for operations on 64-bit integers.
A 8-bit signed integer (represented in two's complement). Provides no operations and used only for storage and interaction with external code.
A signed two's complement integer equal to an intptr_t
in C, i.e.
it has the same bit-size as a native pointer (void*
).
Provides no operations but is used mostly for interaction with external code.
The Javascript backend uses int64
for this.
A local variable var<s,a>
points to a value of type a
in local scope s
.
Read the value of a local variable.
Allocate a fresh local with an initial value.
Assign a new value to a local variable.
The maybestd/core/types/maybe: V -> V
type is used to represent either a value (Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(x)
) or Nothingstd/core/types/Nothing: forall<a> maybe<a>
.
This type is often used to represent values that can be null.
Automatically generated. Tests for the Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>
constructor of the maybestd/core/types/maybe: V -> V
type.
Automatically generated. Tests for the Nothingstd/core/types/Nothing: forall<a> maybe<a>
constructor of the maybestd/core/types/maybe: V -> V
type.
The non-determism effect.
Internal: Optional is used by the compiler to pass optional arguments.
It is usually displayed as :?a
for some type a
.
Nonestd/core/types/None: forall<a> ?a
is used when an optional argument is not provided.
The Optionalstd/core/types/Optional: forall<a> (value : a) -> ?a
constructor is used when an optional argument is given.
Automatically generated. Tests for the Nonestd/core/types/None: forall<a> ?a
constructor of the optionalstd/core/types/optional: V -> V
type.
Automatically generated. Tests for the Optionalstd/core/types/Optional: forall<a> (value : a) -> ?a
constructor of the optionalstd/core/types/optional: V -> V
type.
An enumeration to represent order.
Automatically generated. Tests for the Eqstd/core/types/Eq: order
constructor of the orderstd/core/types/order: V
type.
Automatically generated. Tests for the Gtstd/core/types/Gt: order
constructor of the orderstd/core/types/order: V
type.
Automatically generated. Tests for the Ltstd/core/types/Lt: order
constructor of the orderstd/core/types/order: V
type.
The read effect: signifies that a function may read from from heap h
.
A reference refstd/core/types/ref: (H, V) -> V<h,a>
points to a value of type a
in heap h
.
Read the value of a reference.
Modify the value of a reference. This is especially useful when the reference contains a vector, because getting the vector into a local variable and then setting it back into the reference later would mean that we hold on to a copy (and we can't update the vector in place then!). In contrast, this function passes the ownership to the given function.
Allocate a fresh reference with an initial value.
Assign a new value to a reference.
Internal type used for in-place update of unique pattern matches.
A signed two's complement integer equal to a signed size_t
in C, i.e.
it can hold the byte size of any object, in particular the maximum possible
byte size of a vector or string.
Provides no operations but is used mostly for interaction with external code.
The Javascript backend uses int32
for this.
Stateful functions can manipulate heap h
using allocations, reads and writes.
A string is a sequence of unicode character points (char
).
The encoding of a string is internal and there
is no constant-time indexing of characters in a string.
Use the sslice
type for efficient matching and retrieving
sub-strings from string.
The type of immutable arrays is called vectorstd/core/types/vector: V -> V
.
The write effect: signifies that a function may write to heap h
.
Internal: used to pass locals by reference.
The identity function returns its argument unchanged.
Internal: if local mutation is unobservable, the localstd/core/types/local: H -> X
effect can be erased by using the local-scopestd/core/types/local-scope: forall<a,e> (action : forall<h> () -> <local<h>|e> a) -> e a
function.
See also: State in Haskell, by Simon Peyton Jones and John Launchbury.
If a heap effect is unobservable, the heap effect can be erased by using the runstd/core/types/run: forall<e,a> (action : forall<h> () -> <alloc<h>,read<h>,write<h>|e> a) -> e a
fun.
See also: State in Haskell, by Simon Peyton Jones and John Launchbury.
Unsafe. Mark a function parameter as decreasing to suppress the non-termination effect (divstd/core/types/div: X
).
Unsafe. This function pretends the give action is terminating.
Unsafe. This function pretends the give action was deterministic.
Unsafe. This function calls a function and pretends it did not have any effect at all.
Core types.
This module is implicitly imported and all functions and types are always available. These types are required to be defined for the compiler to work correctly (i.e. types like
intstd/core/types/int: V
ordivstd/core/types/div: X
).