types +linux +x86_64

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.

Index

Types

type floating;
type integer;
type numeric;
type signed;
type slice;
type string;
type unsigned;

Constants

const I16_MAX: i16;
const I16_MIN: i16;
const I32_MAX: i32;
const I32_MIN: i32;
const I64_MAX: i64;
const I64_MIN: i64;
const I8_MAX: i8;
const I8_MIN: i8;
const INT_MAX: int;
const INT_MIN: int;
const RUNE_MAX: rune;
const RUNE_MIN: rune;
const SIZE_MAX: size;
const SIZE_MIN: size;
const U16_MAX: u16;
const U16_MIN: u16;
const U32_MAX: u32;
const U32_MIN: u32;
const U64_MAX: u64;
const U64_MIN: u64;
const U8_MAX: u8;
const U8_MIN: u8;
const UINTPTR_MAX: uintptr;
const UINTPTR_MIN: uintptr;
const UINT_MAX: uint;
const UINT_MIN: uint;

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 *void, // 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;

Maximum value which can be stored in an i16 type.

def I16_MIN[link]

def I16_MIN: i16;

Minimum value which can be stored in an i16 type.

def I32_MAX[link]

def I32_MAX: i32;

Maximum value which can be stored in an i32 type.

def I32_MIN[link]

def I32_MIN: i32;

Minimum value which can be stored in an i32 type.

def I64_MAX[link]

def I64_MAX: i64;

Maximum value which can be stored in an i64 type.

def I64_MIN[link]

def I64_MIN: i64;

Minimum value which can be stored in an i64 type

def I8_MAX[link]

def I8_MAX: i8;

Maximum value which can be stored in an i8 type.

def I8_MIN[link]

def I8_MIN: i8;

Minimum value which can be stored in an i8 type.

def INT_MAX[link]

def INT_MAX: int;

Maximum value which can be stored in an int type.

def INT_MIN[link]

def INT_MIN: int;

Minimum value which can be stored in an int type.

def RUNE_MAX[link]

def RUNE_MAX: rune;

Maximum value which can be stored in a rune.

def RUNE_MIN[link]

def RUNE_MIN: rune;

Maximum value which can be stored in a rune.

def SIZE_MAX[link]

def SIZE_MAX: size;

Maximum value which can be stored in a size type.

def SIZE_MIN[link]

def SIZE_MIN: size;

Minimum value which can be stored in a size type

def U16_MAX[link]

def U16_MAX: u16;

Maximum value which can be stored in a u16 type.

def U16_MIN[link]

def U16_MIN: u16;

Minimum value which can be stored in a u16 type

def U32_MAX[link]

def U32_MAX: u32;

Maximum value which can be stored in a u32 type.

def U32_MIN[link]

def U32_MIN: u32;

Minimum value which can be stored in a u32 type

def U64_MAX[link]

def U64_MAX: u64;

Maximum value which can be stored in a u64 type.

def U64_MIN[link]

def U64_MIN: u64;

Minimum value which can be stored in a u64 type

def U8_MAX[link]

def U8_MAX: u8;

Maximum value which can be stored in a u8 type.

def U8_MIN[link]

def U8_MIN: u8;

Minimum value which can be stored in a u8 type.

def UINTPTR_MAX[link]

def UINTPTR_MAX: uintptr;

Maximum value which can be stored in a uintptr type.

def UINTPTR_MIN[link]

def UINTPTR_MIN: uintptr;

Minimum value which can be stored in a uintptr type

def UINT_MAX[link]

def UINT_MAX: uint;

Maximum value which can be stored in a uint type.

def UINT_MIN[link]

def UINT_MIN: uint;

Minimum value which can be stored in a uint type