Expand description
Const-constructible type definitions for Harn builtin signatures.
Both harn-parser (for typechecking) and harn-vm (for runtime metadata)
consume these shapes. Living in a dep-free crate lets the parser see the
types without depending on the VM, and lets the #[harn_builtin] proc-macro
emit const literals that link into either side.
Ty::to_type_expr and friends, which convert into the parser’s runtime
TypeExpr, live in harn-parser since they depend on parser-internal AST.
The shapes submodule holds the named structural-record consts
(LLM_CALL_OPTIONS, LLM_CALL_RESULT, TRANSCRIPT, …) shared by the
parser’s static typechecking tables and the #[harn_builtin] macro’s
@NAME signature injection.
Modules§
- shapes
- Shared structural-record
Ty::Shapealiases reused across builtin signatures. - signatures
- Canonical
BuiltinSignaturedefinitions for builtins that bothharn-parser(typecheck) andharn-vm(runtime) must agree on at compile time.
Structs§
- Builtin
Metadata - Public view of one builtin used by
harn-lintand other crates that need just identifier + return-type hints (no parameter types). - Builtin
Signature - A complete, static description of one builtin: identifier, arity range, per-parameter types, generic type parameters, return type, and any where-clause bounds the type checker should enforce on call.
- Param
- One parameter slot inside a
BuiltinSignature. - Shape
Field Descriptor
Enums§
- Ty
const-friendly type IR used in builtin descriptors. Mirrors the runtimeTypeExprfromharn-parserbut is constructable inconstposition with no allocation. Convert toTypeExprat the boundary via the parser-sideTy::to_type_exprhelper.
Constants§
- TY_ANY
- TY_BOOL
- TY_
BYTES - TY_
BYTES_ OR_ NIL bytes | nil.- TY_
CLOSURE - TY_
DECIMAL - TY_DICT
- TY_
DICT_ OR_ NIL dict | nil.- TY_
DURATION - TY_
FLOAT - TY_INT
- TY_
INT_ OR_ NIL int | nil.- TY_LIST
- TY_
NEVER - TY_NIL
- TY_
NUMBER int | float.- TY_
STRING - TY_
STRING_ OR_ NIL string | nil.