types
The types module provides access to some information about the Hare type system. It provides constants like INT_MAX, which defines the useful range for integer types (see math:: for f32 and f64 limits), as well as types like slice, which describe the internal structure of data types like slices and str.
Submodules
Index
Types
type floating = (f32 | f64);
type integer = (...signed | ...unsigned);
type numeric = (...integer | ...floating);
type signed = (i8 | i16 | i32 | i64 | int);
type slice = struct {
data: nullable *opaque,
length: size,
capacity: size,
};
type string = struct {
data: nullable *[*]u8,
length: size,
capacity: size,
};
type unsigned = (u8 | u16 | u32 | u64 | uint | size);
Constants
def I16_MAX: i16 = 32767;
def I16_MIN: i16 = -32768;
def I32_MAX: i32 = 2147483647;
def I32_MIN: i32 = -2147483648;
def I64_MAX: i64 = 9223372036854775807;
def I64_MIN: i64 = -9223372036854775808i64;
def I8_MAX: i8 = 127;
def I8_MIN: i8 = -128;
def INT_MAX: int = I32_MAX;
def INT_MIN: int = I32_MIN;
def RUNE_MAX: rune = '';
def RUNE_MIN: rune = '