Skip to main content

Module types

Module types 

Source
Expand description

Unified Type System

This module provides a unified type representation used across Pack:

  • Design-time (parsing, validation)
  • Runtime metadata (embedded in WASM packages)
  • ABI encoding/decoding

Key design decisions:

  • Arena as unified scoping structure
  • Lexical scoping with qualified paths for cross-arena references
  • Nominal typing - names are part of identity
  • Unit is explicit - no more optional ok/err in Result
  • Everything derives Hash - enables hash-based comparison
  • Value kept as dynamic escape hatch

Structs§

Arena
An arena containing type definitions, functions, and child arenas.
Case
A variant case.
Field
A record field.
Function
A function signature with parameters and results.
Param
A function parameter.
TypePath
A qualified path to a type.

Enums§

Type
A type reference.
TypeDef
A type definition (named type).

Functions§

sexpr_type
Helper to build an sexpr type (common use case).