types+x86_64 +linux

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 {
	// The slice contents.
	data: nullable *opaque,
	// The number of members of the slice.
	length: size,
	// The allocated capacity (in members) of data.
	capacity: size,
};
type string = struct {
	// UTF-8 encoded octets.
	data: nullable *[*]u8,
	// The length capacity, in octets of UTF-8 data.
	length: size,
	// The allocated capacity, in octets of UTF-8 data.
	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 = '';
def SIZE_MAX: size = U64_MAX;
def SIZE_MIN: size = U64_MIN;
def U16_MAX: u16 = 65535;
def U16_MIN: u16 = 0;
def U32_MAX: u32 = 4294967295;
def U32_MIN: u32 = 0;
def U64_MAX: u64 = 18446744073709551615;
def U64_MIN: u64 = 0;
def U8_MAX: u8 = 255;
def U8_MIN: u8 = 0;
def UINTPTR_MAX: uintptr = U64_MAX: uintptr;
def UINTPTR_MIN: uintptr = U64_MIN: uintptr;
def UINT_MAX: uint = U32_MAX;
def UINT_MIN: uint = U32_MIN;

Types

type floating[link]

type floating = (f32 | f64);

A tagged union of all floating point numeric types.

type integer[link]

type integer = (...signed | ...unsigned);

A tagged union of all integer types.

type numeric[link]

type numeric = (...integer | ...floating);

A tagged union of all numeric types.

type signed[link]

type signed = (i8 | i16 | i32 | i64 | int);

A tagged union of all signed integer types.

type slice[link]

type slice = struct {
	// The slice contents.
	data: nullable *opaque,
	// The number of members of the slice.
	length: size,
	// The allocated capacity (in members) of data.
	capacity: size,
};

A type representing the internal structure of slices, useful for low-level slice manipulation.

type string[link]

type string = struct {
	// UTF-8 encoded octets.
	data: nullable *[*]u8,
	// The length capacity, in octets of UTF-8 data.
	length: size,
	// The allocated capacity, in octets of UTF-8 data.
	capacity: size,
};

A type representing the internal structure of strings, useful for low-level string manipulation.

type unsigned[link]

type unsigned = (u8 | u16 | u32 | u64 | uint | size);

A tagged union of all unsigned integer types, excluding uintptr.

Constants

def I16_MAX[link]

def I16_MAX: i16 = 32767;

Maximum value which can be stored in an i16 type.

def I16_MIN[link]

def I16_MIN: i16 = -32768;

Minimum value which can be stored in an i16 type.

def I32_MAX[link]

def I32_MAX: i32 = 2147483647;

Maximum value which can be stored in an i32 type.

def I32_MIN[link]

def I32_MIN: i32 = -2147483648;

Minimum value which can be stored in an i32 type.

def I64_MAX[link]

def I64_MAX: i64 = 9223372036854775807;

Maximum value which can be stored in an i64 type.

def I64_MIN[link]

def I64_MIN: i64 = -9223372036854775808i64;

Minimum value which can be stored in an i64 type

def I8_MAX[link]

def I8_MAX: i8 = 127;

Maximum value which can be stored in an i8 type.

def I8_MIN[link]

def I8_MIN: i8 = -128;

Minimum value which can be stored in an i8 type.

def INT_MAX[link]

def INT_MAX: int = I32_MAX;

Maximum value which can be stored in an int type.

def INT_MIN[link]

def INT_MIN: int = I32_MIN;

Minimum value which can be stored in an int type.

def RUNE_MAX[link]

def RUNE_MAX: rune = '􏿿';

Maximum Unicode codepoint which can be stored in a rune.

def RUNE_MIN[link]

def RUNE_MIN: rune = '';

Minimum Unicode codepoint which can be stored in a rune.

def SIZE_MAX[link]

def SIZE_MAX: size = U64_MAX;

Maximum value which can be stored in a size type.

def SIZE_MIN[link]

def SIZE_MIN: size = U64_MIN;

Minimum value which can be stored in a size type

def U16_MAX[link]

def U16_MAX: u16 = 65535;

Maximum value which can be stored in a u16 type.

def U16_MIN[link]

def U16_MIN: u16 = 0;

Minimum value which can be stored in a u16 type

def U32_MAX[link]

def U32_MAX: u32 = 4294967295;

Maximum value which can be stored in a u32 type.

def U32_MIN[link]

def U32_MIN: u32 = 0;

Minimum value which can be stored in a u32 type

def U64_MAX[link]

def U64_MAX: u64 = 18446744073709551615;

Maximum value which can be stored in a u64 type.

def U64_MIN[link]

def U64_MIN: u64 = 0;

Minimum value which can be stored in a u64 type

def U8_MAX[link]

def U8_MAX: u8 = 255;

Maximum value which can be stored in a u8 type.

def U8_MIN[link]

def U8_MIN: u8 = 0;

Minimum value which can be stored in a u8 type.

def UINTPTR_MAX[link]

def UINTPTR_MAX: uintptr = U64_MAX: uintptr;

Maximum value which can be stored in a uintptr type.

def UINTPTR_MIN[link]

def UINTPTR_MIN: uintptr = U64_MIN: uintptr;

Minimum value which can be stored in a uintptr type

def UINT_MAX[link]

def UINT_MAX: uint = U32_MAX;

Maximum value which can be stored in a uint type.

def UINT_MIN[link]

def UINT_MIN: uint = U32_MIN;

Minimum value which can be stored in a uint type