(a) -> maybe<a>
() -> maybe<a>
(a) -> either<a,b>
(b) -> either<a, b>
The list record type represents an ordered series of elements of a given length.
alias list<a, n : int> = { data : a[n], length : uint32 }
data : a[n] | The internal array used to store the elements. |
length : uint32 | The length of the list |
The charlist alias represents a list of extended ASCII characters at most length n (this does not include the final null byte). To get the length of the string not including the null byte, use CharList:length.
alias charlist<n : int> = list<uint8, n+1>
data : uint8[n+1] length : uint32
The signal type encapsulates the concept of a signal. At any point in time, a signal may having nothing travelling through it, or something travelling through it.
sig<a>
signal (maybe<a>)
(maybe<a>) -> sig<a>
Extracts the contained ptr from a rcptr (reference counted pointer).
(rcptr) -> ptr
p : rcptr | The pointer to extract the rawpointer from |
The extracted rawpointer
Creates a reference counting cell to attach to a pointer. When the reference count reaches 0, the finalizer will be called with the underlying ptr as a parameter. The finalizer must have an empty closure.
(ptr, (||)(ptr) -> unit) -> rcptr
p : The pointer that will be garbage collected once the counter reaches 0. finalizer : (||)(ptr) -> unit the destructor that will be called once there
A new reference counted pointer.
Composes two functions together.
((b) -> c, (a) -> b) -> ((a) -> c)
f : (b) -> c | The second function to compose |
g : (a) -> b | The first function to compose |
A composed function equivalent to f(g(x))
The identity function.
(a) -> a
x : a | The value to return |
The input value
Curries a function with an argument arity of 2.
((a, b) -> c) -> ((a) -> (b) -> c)
f : (a, b) -> c | The function to curry. |
A curried function
Uncurries a function with an argument arity of 2.
((a) -> (b) -> c) -> ((a, b) -> c)
f : (a) -> (b) -> c | The function to uncurry. |
A uncurried function
Curries a function with an argument arity of 3.
((a, b, c) -> d) -> ((a) -> (b) -> (c) -> d)
f : (a, b, c) -> d | The function to curry. |
A curried function
Uncurries a function with an argument arity of 3.
((a) -> (b) -> (c) -> d) -> ((a, b, c) -> d)
f : (a) -> (b) -> (c) -> d | The function to uncurry |
An uncurried function
A function representation of the equality operator
(a, a) -> bool
x : a | The first value to compare |
y : a | The second value to compare |
True if the values are equivalent, false otherwise.
A function representation of the inequality operator
(a, a) -> bool
x : a | The first value to compare |
y : a | The second value to compare |
False if the values are equivalent, true otherwise.
A function representation of the greater than operator
(a, b) -> bool where a : num, b : num
x : a | The first value to compare |
y : b | The second value to compare |
True if x > y, false otherwise.
A function representation of the greater than or equal operator
(a, b) -> bool where a : num, b : num
x : a | The first value to compare |
y : b | The second value to compare |
True if x >= y, false otherwise.
A function representation of the less than operator
(a, b) -> bool where a : num, b : num
x : a | The first value to compare |
y : b | The second value to compare |
True if x < y, false otherwise.
A function representation of the less than or equal operator
(a, b) -> bool where a : num, b : num
x : a | The first value to compare |
y : b | The second value to compare |
True if x <= y, false otherwise.
A function representation of the not operator
(bool) -> bool
x : bool | The value to take the logical inverse of |
The logical inverse of x
A function representation of the && operator
(bool, bool) -> bool
x : bool | The first boolean value |
y : bool | The second boolean value |
x && y
A function representation of the or operator
(bool, bool) -> bool
x : bool | The first boolean value |
y : bool | The second boolean value |
x or y
Applies a tuple of values to the given function
((a,b) -> c, (a,b)) -> c
f : (a,b) -> c | The function to apply |
tup : (a,b) | The values to pass to the function |
The result of the values held in the tuple applied to f
Applies a tuple of values to the given function
((a,b,c) -> d, (a,b,c)) -> d
f : (a,b,c) -> d | The function to apply |
tup : (a,b,c) | The values to pass to the function |
The result of the values held in the tuple applied to f
Applies a tuple of values to the given function
((a,b,c,d) -> e, (a,b,c,d)) -> e
f : (a,b,c,d) -> e | The function to apply |
tup : (a,b,c,d) | The values to pass to the function |
The result of the values held in the tuple applied to f
Gives the first element of a two element tuple.
((a, b)) -> a
tup : (a, b) | The tuple to extract the first element from |
The first element of the two element tuple.
Gives the second element of a two element tuple.
((a, b)) -> b
tup : (a, b) | The tuple to extract the second element from |
The second element of the two element tuple.
Adds the two arguments together.
(a, a) -> a where a : num
numA : a | The first number |
numB : a | The second number |
The sum of the two numbers
Subtracts the two arguments
(a, a) -> a where a : num
numA : a | The first number |
numB : a | The second number |
The difference of the two numbers
Multiplies the two arguments together.
(a, a) -> a where a : num
numA : a | The first number |
numB : a | The second number |
The product of the two numbers
Divides one number by the other.
(a, a) -> a where a : num
numA : a | The numerator |
numB : a | The denominator |
The difference of the two numbers
Swaps the two elements of a tuple
((a,b)) -> (b,a)
tup : (a,b) | The tuple to swap |
The tuple with swapped elements
Yields the result of applying f until p holds.
((a) -> bool, (a) -> a, a) -> a
p: (a) -> bool | The predicate |
f: (a) -> a | The function to repeatedly apply |
a0: a | The initial value to supply to the function |
Takes a value as a parameter and ignores it.
(a) -> unit
Clears a variable by calling that type's C++ destructor and setting the memory to zero. This function is designed to be compatible with clearing ref cells or data structures containg ref cells. This function is useful for clearing portions of data structures that hold data that should be thrown away. Note that due to the destructor call, clear should only be used on elements that have already been initialized.
(inout a) -> unit
val : inout a | The memory to clear. |
unit
Creates an array containing the given element, with the size of the array being determined by the capacity constraint on the return type.
(a) -> a[n]
elem : a | The element to fill the initial array slots with. |
A newly populated array.
Creates an array filled with zeros. This function is designed to work with ref types. The type and capacity of the return array is determined by constraining the return type.
() -> a[n]
A new array populated with zero initialized elements.
Converts a uint8 to a uint16.
(uint8) ->uint16
n : uint8 | The number to convert |
The number with converted type
Converts a uint8 to a uint32.
(uint8) ->uint32
n : uint8 | The number to convert |
The number with converted type
Converts a uint8 to a int8.
(uint8) ->int8
n : uint8 | The number to convert |
The number with converted type
Converts a uint8 to a int16.
(uint8) ->int16
n : uint8 | The number to convert |
The number with converted type
Converts a uint8 to a int32.
(uint8) ->int32
n : uint8 | The number to convert |
The number with converted type
Converts a uint8 to a float.
(uint8) ->float
n : uint8 | The number to convert |
The number with converted type
Converts a uint8 to a double.
(uint8) ->double
n : uint8 | The number to convert |
The number with converted type
Converts a uint16 to a uint8.
(uint16) ->uint8
n : uint16 | The number to convert |
The number with converted type
Converts a uint16 to a uint32.
(uint16) ->uint32
n : uint16 | The number to convert |
The number with converted type
Converts a uint16 to a int8.
(uint16) ->int8
n : uint16 | The number to convert |
The number with converted type
Converts a uint16 to a int16.
(uint16) ->int16
n : uint16 | The number to convert |
The number with converted type
Converts a uint16 to a int32.
(uint16) ->int32
n : uint16 | The number to convert |
The number with converted type
Converts a uint16 to a float.
(uint16) ->float
n : uint16 | The number to convert |
The number with converted type
Converts a uint16 to a double.
(uint16) ->double
n : uint16 | The number to convert |
The number with converted type
Converts a uint32 to a uint8.
(uint32) ->uint8
n : uint32 | The number to convert |
The number with converted type
Converts a uint32 to a uint16.
(uint32) ->uint16
n : uint32 | The number to convert |
The number with converted type
Converts a uint32 to a int8.
(uint32) ->int8
n : uint32 | The number to convert |
The number with converted type
Converts a uint32 to a int16.
(uint32) ->int16
n : uint32 | The number to convert |
The number with converted type
Converts a uint32 to a int32.
(uint32) ->int32
n : uint32 | The number to convert |
The number with converted type
Converts a uint32 to a float.
(uint32) ->float
n : uint32 | The number to convert |
The number with converted type
Converts a uint32 to a double.
(uint32) ->double
n : uint32 | The number to convert |
The number with converted type
Converts a int8 to a uint8.
(int8) ->uint8
n : int8 | The number to convert |
The number with converted type
Converts a int8 to a uint16.
(int8) ->uint16
n : int8 | The number to convert |
The number with converted type
Converts a int8 to a uint32.
(int8) ->uint32
n : int8 | The number to convert |
The number with converted type
Converts a int8 to a int16.
(int8) ->int16
n : int8 | The number to convert |
The number with converted type
Converts a int8 to a int32.
(int8) ->int32
n : int8 | The number to convert |
The number with converted type
Converts a int8 to a float.
(int8) ->float
n : int8 | The number to convert |
The number with converted type
Converts a int8 to a double.
(int8) ->double
n : int8 | The number to convert |
The number with converted type
Converts a int16 to a uint8.
(int16) ->uint8
n : int16 | The number to convert |
The number with converted type
Converts a int16 to a uint16.
(int16) ->uint16
n : int16 | The number to convert |
The number with converted type
Converts a int16 to a uint32.
(int16) ->uint32
n : int16 | The number to convert |
The number with converted type
Converts a int16 to a int8.
(int16) ->int8
n : int16 | The number to convert |
The number with converted type
Converts a int16 to a int32.
(int16) ->int32
n : int16 | The number to convert |
The number with converted type
Converts a int16 to a float.
(int16) ->float
n : int16 | The number to convert |
The number with converted type
Converts a int16 to a double.
(int16) ->double
n : int16 | The number to convert |
The number with converted type
Converts a int32 to a uint8.
(int32) ->uint8
n : int32 | The number to convert |
The number with converted type
Converts a int32 to a uint16.
(int32) ->uint16
n : int32 | The number to convert |
The number with converted type
Converts a int32 to a uint32.
(int32) ->uint32
n : int32 | The number to convert |
The number with converted type
Converts a int32 to a int8.
(int32) ->int8
n : int32 | The number to convert |
The number with converted type
Converts a int32 to a int16.
(int32) ->int16
n : int32 | The number to convert |
The number with converted type
Converts a int32 to a float.
(int32) ->float
n : int32 | The number to convert |
The number with converted type
Converts a int32 to a double.
(int32) ->double
n : int32 | The number to convert |
The number with converted type
Converts a float to a uint8.
(float) ->uint8
n : float | The number to convert |
The number with converted type
Converts a float to a uint16.
(float) ->uint16
n : float | The number to convert |
The number with converted type
Converts a float to a uint32.
(float) ->uint32
n : float | The number to convert |
The number with converted type
Converts a float to a int8.
(float) -> int8
n : float | The number to convert |
The number with converted type
Converts a float to a int16.
(float) -> int16
n : float | The number to convert |
The number with converted type
Converts a float to a int32.
(float) ->int32
n : float | The number to convert |
The number with converted type
Converts a float to a double.
(float) ->double
n : float | The number to convert |
The number with converted type
Converts a double to a uint8.
(double) ->uint8
n : double | The number to convert |
The number with converted type
Converts a double to a uint16.
(double) -> uint16
n : double | The number to convert |
The number with converted type
Converts a double to a uint32.
(double) -> uint32
n : double | The number to convert |
The number with converted type
Converts a double to a int8.
(double) -> int8
n : double | The number to convert |
The number with converted type
Converts a double to a int16.
(double) -> int16
n : double | The number to convert |
The number with converted type
Converts a double to a int32.
(double) -> int32
n : double | The number to convert |
The number with converted type
Converts a double to a float.
(double) -> float
n : double | The number to convert |
The number with converted type
Converts a number to a uint8.
(t) -> uint8 where t : num
n : t | The number to convert |
The number with converted type
Converts a number to a int8.
(t) -> int8 where t : num
n : t | The number to convert |
The number with converted type
Converts a number to a uint16.
(t) -> uint16 where t : num
n : t | The number to convert |
The number with converted type
Converts a number to a uint16.
(t) -> uint16 where t : num
n : t | The number to convert |
The number with converted type
Converts a number to a uint32.
(t) -> uint32 where t : num
n : t | The number to convert |
The number with converted type
Converts a number to a int32.
(t) -> int32 where t : num
n : t | The number to convert |
The number with converted type
Converts a number to a float.
(t) -> float where t : num
n : t | The number to convert |
The number with converted type
Converts a number to a double.
(t) -> double where t : num
n : t | The number to convert |
The number with converted type
Converts a uint8 to another number type.
(uint8) -> t where t : num
n : uint8 | The number to convert |
The number with converted type
Converts a int8 to another number type.
(int8) -> t where t : num
n : int8 | The number to convert |
The number with converted type
Converts a uint16 to another number type.
(uint16) -> t where t : num
n : uint16 | The number to convert |
The number with converted type
Converts a int16 to another number type.
(int16) -> t where t : num
n : int16 | The number to convert |
The number with converted type
Converts a uint32 to another number type.
(uint32) -> t where t : num
n : uint32 | The number to convert |
The number with converted type
Converts a int32 to another number type.
(int32) -> t where t : num
n : int32 | The number to convert |
The number with converted type
Converts a float to another number type.
(float) -> t where t : num
n : float | The number to convert |
The number with converted type
Converts a double to another number type.
(double) -> t where t : num
n : double | The number to convert |
The number with converted type
Converts a number of one type to a number of another type.
(a) -> b where a : num, b : num
x : a | The number to convert |
The number with converted type