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.
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
type floating = (f32 | f64);
A tagged union of all floating point numeric types.
type integer
type integer = (...signed | ...unsigned);
A tagged union of all integer types.
type numeric
type numeric = (...integer | ...floating);
A tagged union of all numeric types.
type signed
type signed = (i8 | i16 | i32 |
i64 | int);
A tagged union of all signed integer types.
type slice
type slice = struct {
data: nullable *void,
length: size,
capacity: size,
};
A type representing the internal structure of slices, useful for low-level
slice manipulation.
type string
type string = struct {
data: nullable *[*]u8,
length: size,
capacity: size,
};
A type representing the internal structure of strings, useful for low-level
string manipulation.
type unsigned
type unsigned = (u8 | u16 | u32 |
u64 | uint | size);
A tagged union of all unsigned integer types, excluding uintptr.
Constants
def I16_MAX
def I16_MAX: i16;
Maximum value which can be stored in an i16 type.
def I16_MIN
def I16_MIN: i16;
Minimum value which can be stored in an i16 type.
def I32_MAX
def I32_MAX: i32;
Maximum value which can be stored in an i32 type.
def I32_MIN
def I32_MIN: i32;
Minimum value which can be stored in an i32 type.
def I64_MAX
def I64_MAX: i64;
Maximum value which can be stored in an i64 type.
def I64_MIN
def I64_MIN: i64;
Minimum value which can be stored in an i64 type
def I8_MAX
def I8_MAX: i8;
Maximum value which can be stored in an i8 type.
def I8_MIN
def I8_MIN: i8;
Minimum value which can be stored in an i8 type.
def INT_MAX
def INT_MAX: int;
Maximum value which can be stored in an int type.
def INT_MIN
def INT_MIN: int;
Minimum value which can be stored in an int type.
def RUNE_MAX
def RUNE_MAX: rune;
Maximum value which can be stored in a rune.
def RUNE_MIN
def RUNE_MIN: rune;
Maximum value which can be stored in a rune.
def SIZE_MAX
def SIZE_MAX: size;
Maximum value which can be stored in a size type.
def SIZE_MIN
def SIZE_MIN: size;
Minimum value which can be stored in a size type
def U16_MAX
def U16_MAX: u16;
Maximum value which can be stored in a u16 type.
def U16_MIN
def U16_MIN: u16;
Minimum value which can be stored in a u16 type
def U32_MAX
def U32_MAX: u32;
Maximum value which can be stored in a u32 type.
def U32_MIN
def U32_MIN: u32;
Minimum value which can be stored in a u32 type
def U64_MAX
def U64_MAX: u64;
Maximum value which can be stored in a u64 type.
def U64_MIN
def U64_MIN: u64;
Minimum value which can be stored in a u64 type
def U8_MAX
def U8_MAX: u8;
Maximum value which can be stored in a u8 type.
def U8_MIN
def U8_MIN: u8;
Minimum value which can be stored in a u8 type.
def UINTPTR_MAX
def UINTPTR_MAX: uintptr;
Maximum value which can be stored in a uintptr type.
def UINTPTR_MIN
def UINTPTR_MIN: uintptr;
Minimum value which can be stored in a uintptr type
def UINT_MAX
def UINT_MAX: uint;
Maximum value which can be stored in a uint type.
def UINT_MIN
def UINT_MIN: uint;
Minimum value which can be stored in a uint type