Expand description
Unification engine for the bidirectional type checker.
Provides Robinson unification for InferType, which extends LogosType
with type variables for the inference pass. After inference, UnificationTable::zonk
converts InferType → LogosType. Unsolved variables become LogosType::Unknown,
preserving the existing codegen safety net.
§Architecture
InferType ← inference pass (this module + check.rs)
│
│ zonk (after inference)
▼
LogosType → codegen (unchanged)Structs§
- TyVar
- A type variable used during inference.
- Type
Scheme - A quantified polymorphic type.
- Unification
Table - Union-Find table implementing Robinson unification with occurs check.
Enums§
- Infer
Type - Inference-time type representation.
- Type
Error - A type error detected during unification or checking.
Functions§
- infer_
to_ logos - Convert a zonked
InferTypetoLogosType. - unify_
numeric - Numeric promotion: Float wins; Int + Int = Int; Nat + Nat = Nat; Byte + Byte = Byte; otherwise error.