Expand description
Abstract syntax tree types for Bynk v0 (spec §9.2).
Structs§
- Actor
Decl - An actor declaration (v0.45 §3.7). An actor is a nominal contract type
describing an external party at a boundary — not a runnable entity. A
handler consumes an actor on its
byclause; the boundary verifies the declaredauthscheme and mints a sealed identity (name.identity). - Actor
Refinement - The reserved refinement form
actor Admin = User where <predicate>(Q3). Parsed in Foundations so the grammar is fixed; admission is a later slice. - Adapter
Decl - An
adapter qualified.name { … }declaration (v0.17 §3.1). An adapter co-locates a capability contract with a non-Bynk binding: it may declare capabilities, the boundary types they reference, inline pure helpertype/fn(anduses), external (bodiless) providers,exports capability, and exactly onebindingclause. It may not declare services, agents, or bodied providers. Like commons/contexts it may be split across files in a directory. - Advance
Stmt - #2137:
advance <Cap> by <amount>— moves the case’s harness clock forward by aDuration.capmust beClock(the checker refuses any other). - Agent
Decl - An agent declaration (v0.5 §3.6). Agents are state-bearing entities with their own handlers.
- Annotation
- A storage annotation on a
storefield (v0.85, storage track; ADR 0111):@<name>(<args>). Thenameis matched against the closed registry (@indexed/@ttl/@retain/@bounded) by the checker; the grammar accepts any identifier so an unknown name is a checker diagnostic, not a parse error. Arguments are compile-time metadata, restricted to literals (and theby:field-name labels of@indexed) by the checker per ADR 0111 D4. - Annotation
Arg - A single annotation argument (v0.85; ADR 0111): an optional
label:followed by a value expression —by: orderId(labelled) or5.minutes(positional). The value is parsed as an ordinaryExprso the duration-literal form (5.minutes, landing with theDurationslice) needs no special grammar; the checker restricts it to a literal where the annotation is functional. - Asset
Decl asset name = "path"(#1883, slice 1a): one static file, served by the platform at a content-hashed URL and never reaching the Worker, so public by construction.nameis a value of the built-in typeAsset([DECISION H]), whose.urlis that URL.- Assign
Stmt name := expr— aCellstore write (v0.81, storage track).targetis theCellfield being written (a bare name for now; the checker resolves it to astorefield).valueis the new value.- Binding
Decl - A
binding "<module>" [includes [ … ]] requires { "pkg": "range", … }clause inside an adapter (v0.17 §3.5).moduleis the TypeScript module supplying the adapter’s external provider symbols, resolved relative to the adapter’s source file.requiresdeclares npm dependencies folded into the generatedpackage.json. - Block
- A brace-delimited block of statements ending in a tail expression whose value is the block’s value (spec v0.1 §3.1).
- ByClause
- The
by (<binder>:)? <Actor>clause on a handler (v0.45; binder optional in v0.50). Names the actor contract the handler consumes; when abinderis given, the verified identity binds to it and is read asbinder.identity. Omitting the binder (by <Actor>) declares-and-verifies the contract without capturing the identity — for anonymous or verify-and-discard handlers. Sits after the protocol config and before the parameters. - Call
Site Actor - v0.182 (testing-the-boundary Slice A, #664): a call-site actor clause on a
test-body
let x <- <service address> by <Actor>(<identity>). Distinct fromByClause(the handler/header form): the declaration names which actor may call and binds the verified identity, whereas the call site names the actor the case is acting as and supplies the identity value. A unit-identity actor (Visitor, and cron/queue’s internal actors) carries noidentity. - CapRef
- A capability reference in a
givenclause (v0.15 §3.2). A bare name is a local capability (given Cap); a dotted name refers to a capability a consumed context provides (given B.Cap/given Alias.Cap). - Capability
Decl - A capability declaration (v0.5 §3.3). Capabilities are interface-like
contracts for external dependencies, used inside contexts. They may only
appear inside a
contextdeclaration. - Capability
Op - One operation in a capability (signature only; no body).
- Case
- A
case "name" [as <tier>] { [stub …] body }block inside a suite (v0.7 §3.3; v0.118 adds the tier clause and case-scoped stubs). - Commons
- A whole parsed commons source file.
- Const
Decl const Name: Type = <static expression>(#2617): a named value, typed by its required annotationty. The initialiserinitis a static expression (ADR 0004) or a reference to another constant; the checker rejects anything else (bynk.resolve.bad_const_initialiser), a name that is not upper-camel (bynk.resolve.const_name_case) and constants whose initialisers refer to each other in a cycle (bynk.resolve.const_cycle). Emitted as an exported, hoisted TypeScript function that caches the value; each reference is a call.- Const
Ref - #3445: the constant an annotation argument named before the resolution pass replaced it with the literal it denotes.
- Consumes
Decl - A
consumes other.contextdeclaration (v0.4 §3.2). May optionally carry an alias introduced byconsumes other.context as Alias(v0.6 §3.1). - Consumes
Item - One name in a braced
consumes U { … }list: a capability or exported type, optionally renamed for this context withName as Alias(#2887). - Context
- A whole parsed context source file (v0.4 §3.1).
- Contract
- A function contract clause (v0.115 §, testing track slice 3). A named
predicate on a
fnsignature — arequires(precondition) orensures(postcondition). A contract is the invariant predicate attached to a function (ADR 0144 — one predicate surface): the predicate is a pureBoolexpression over the parameters (requires) or the parameters plusresult(ensures), withimplies/isand pure methods, mirroringInvariant. The name rides the failure report and the redundant-test dedup. - Cors
Field - One
name: valuefield inside acors { }policy (v0.131). - Cors
Policy - A cross-origin resource-sharing policy on a
from httpservice (v0.131, ADR 0159): thecors { }section in the service body. Parsed leniently as a list ofname: valuefields (the grammar accepts any field name — an unknown one is a checker diagnostic, per the@-annotation precedent, ADR 0111), and interpreted through the typed accessors below. - Decimal
Bound - A decimal refinement bound (#2622):
InRange(0.00d, 100.00d). The coefficient keeps any leading-; the lexeme is the signed source text. - Derived
Capability - The
= Base @option(…)*of a derived capability (S4a, #1966): a new capability name whose operations are those ofbase, a platform capability the unit selects withconsumes U { Base }, provided by the platform adapter’s own provider bound to this instance. - DoStmt
do expr— an effect-performing expression statement (v0.146, ADR 0170).valueis the awaited effect, which MUST be anEffect[T]withTnot aResult.- Doc
- #1888: a documentation comment as written: its normalised text and the
form it was written in. Every
documentationfield holds one. It derefs to its text, so a reader that only wants the Markdown treats it as astr; only the formatter readsDoc::form, to print each doc in the form its author chose (DECISION F: it never converts between them). - Embed
Decl embed name = "path"(#2387, slice 1): one project file whose text is the value ofname, aStringconstant compiled into the code. Unlike anAssetDeclit is never served, so it is private and comes from the project’sembeds/folder rather thanassets/.- Embeds
Clause - One
embeds <source_type> as <variant>mapping in a sum body (v0.154, ADR 0178). Declares that a value ofsource_typecan be auto-wrapped into the named single-payloadvariantof the enclosing sum. - EnvClause
- #2134: a suite- or case-scoped
env { NAME = "value" … }clause — the variables and secrets a suite’s participants see (ADR for #2134).envis contextual: a keyword only at the head of a suite or case body member. - EnvEntry
- #2134: one
NAME = <value>entry of anEnvClause. The value is parsed as an expression; the checker requires aStringliteral. - Event
Decl event Name = { fields }— a typed fact a context may emit and other contexts’ subscriber services may receive (Events track, slice 0, spine #936). Record body only in slice 0 — pattern refinement (subscription side, slice 1) and default-valued fields for additive versioning (slice 3a) both extend a record body, so nothing here forecloses them. An optional@schema(N)annotation (slice 3b) asserts the event’s current wire schema version, embedded intoenv.schemaVersionat emission — seeEventDecl::schema_version. Legal only inside acontext— checker-enforced (bynk.event.outside_context), not grammar, mirroring howcapability/providesare commons-rejected at the parser whileeventinstead followsmessages’ precedent (ADR 0272) of parsing uniformly and letting the checker place it, since unlikecapability/providesaneventhas no meaning to reject early inside anadaptereither.- Event
Pattern - The structural filter on a
from Events(E { field: value, .. })subscription header (Events track, slice 1, spine #936) — deliver-and-filter: every emission still reaches the fan-out mechanism, and the subscriber’s own generated handler evaluates this as a boolean guard before running the body. Deliberately not aPattern— an event is a plain record, not a sum, so it has no tag forPattern::Variantto test; extending the sharedPatternenum to fit would touch parser/checker/emitter/fmt/ tree-sitter/LSP sites and drag in match-exhaustiveness semantics a delivery filter does not need. This amends ADR 0286’s “no bespoke matching engine is introduced for Events” claim; its deliver-and-filter decision is unchanged. No static narrowing: a matching handler body still sees its parameter at its own declared type, never narrowed to a listed field’s specific value (deferred — narrowing needs a singleton-variant type the checker does not have, and waits on the refinement-propagation design questiondesign/bynk-type-system.md§2.5.4 names as still open). - Event
Pattern Field - One
name: valueentry in anEventPattern. - Expect
Stmt - Export
Name - One name in an
exportslist, with its comments (#1797). - Exports
Decl - An
exports visibility { names }clause (v0.4 §3.3) or, v0.15, anexports capability { names }clause. - Expr
- ExprId
- T3.4 (R2.4): a node’s identity, independent of position — allocated once,
monotonically, per expression the parser constructs (
Parser::alloc_expr_idinbynk-syntax/src/parser.rs). Never derived from aSpan, so two expressions occupying the same byte range (a synthetic node, a zero-width span) never collide the way a span-keyed side table could. - Faults
Expr - A fault claim,
<call> [by <Actor>(<identity>)] faults(#1706, #1812).callis the effectful call the claim awaits;principalis the optional call-sitebyclause, read exactly as on an effect-let (let r <- call by User("bob")): it supplies the identity the addressed handler reads. - Field
Init - One field-initialiser inside a record construction expression:
either
name: expror the shorthandname(which requires a binding of the same name in scope and uses its value). - Fixture
Decl fixture name = "path"(#2841): a project file’s text as aStringconstant visible to the declaring suite’scaseandpropertybodies. A fixture is test-only: its text goes into test output, never into a deployable.- Float
Bound - A float refinement bound (v0.21): the parsed value plus the signed source
lexeme (for byte-stable emission). v0.40 (ADR 0073): also the source span,
for the
InRange-swap quick-fix. - FnDecl
- ForAll
- The
for all x: T, … [where <pred>] { … }binder inside aPropertyDecl. - ForAll
Binding - One
for allbinding:name: T, where the runner generates inhabitants ofTfrom its refinements. - Handler
- A handler block —
on call(args) -> T given C1, C2 { body }. Used by both services and agents. - Http
Variant - One variant of the built-in
HttpResult[T]sum (v0.9 §3.3). - Ident
- An identifier with its source span.
- Include
Entry - One path in a binding’s
includes [ … ]list (#2321). - IntBound
- An integer refinement bound (v0.40, ADR 0073): the parsed value plus the
bound’s source span (covering a leading
-). Value-only beyond the span — ints have one canonical printed form, so the formatter stays idempotent without a stored lexeme. The span backs theInRange-swap quick-fix. - IntRange
- An inclusive integer range,
lo..hi,lo..or..hi(patterns track, slice 5, #2699; events slice 4b, #990): the one production a match pattern and avia schema(...)clause share. At least one bound is present — a bare..is the rest marker, never a range. Each bound is an optionally negativeIntliteral, parsed permissively: whether it is in range and whetherlo <= hiare checker questions. - Invariant
- An agent invariant (v0.80 §14). A named predicate over the agent’s state
fields that must hold of every committed state; a commit that would violate
it faults (
InvariantViolation) before the state is persisted. The predicate references state fields by bare name, mirroring the design-notes worked examples (status == Paid implies paymentRef.isSome()). - Json
Field - One
name: valuefield inside ajson { }policy. - Json
Policy - A response-JSON policy on a
from httpservice (#2858): thejson { }section in the service body. Parsed leniently as a list ofname: valuefields (aslimits { }); the closed set isoptions, whose value is the bare identifiertaggedorplain. - Lambda
Expr - A lambda expression (v0.20a):
(params) => expror(params) => { … }.=>is the value arrow (shared withmatch); param annotations are optional where an expected function type supplies them. - Lambda
Param - A lambda parameter. A separate type from
Parambecause its annotation is optional —Param.type_refstays mandatory at every signature site. - LetElse
- #2010: what remains of a
let <pattern> <- e else …(or= e else …) statement once the parser has desugared it. - LetStmt
- Limits
Field - One
name: valuefield inside alimits { }policy (v0.142). - Limits
Policy - A request-body-size policy on a
from httpservice (v0.142, ADR 0165): thelimits { }section in the service body. Parsed leniently as a list ofname: valuefields (an unknown one is a checker diagnostic, per the CORS /security/@-annotation precedent) and interpreted through the typed accessor below. - List
Rest - The trailing
..of a list pattern, with the optional name that binds the remaining elements (..rest). - List
Trivia - #3067: the comments inside a list literal
[a, b, c](and, #3110, a call’s arguments or a record literal’s fields).itemsruns parallel to the elements: the comments above each, and the one at the end of its line.closingholds those before the]. Boxed and absent (None) when the list carries no comment, which keepsExprKindsmall. - Match
Arm - One arm of a
matchexpression:pattern => bodyor, with a guard,pattern if guard => body(guard added in the nested-patterns increment, ADR 0169). A guarded arm matches only when the pattern matches and theBoolguard evaluates true; it never contributes to exhaustiveness. - Message
Entry - One
"code" => "template"entry inside amessagesblock. Both sides are plain string literals — a template’s{name}placeholders are resolved by a compile-time string scan during lowering, not parsed as expressions. - Messages
Decl - One locale’s message bundle (v0.222+):
messages "<tag>" @reference { ... }.tagis aLocaleTagstring literal (like an entry’scode/template); its refinement (bynk.locale.types) is checked bycheck_messages_bundles, which reportsbynk.messages.invalid_locale_tagfor a tag the pattern rejects. - Migrate
Decl - A migration step (state-migrations S2, #2224):
migrate from N (old: T) { … }.oldnames a record type declaring the version-Nfields the step reads; the body assigns currentstorefields with record-literal semantics (each at most once, order-free, a bare field reads its carried value) and acknowledges removed or uncovered fields withdrop. - Migrate
Drop drop finside a migration step.- Migrate
Old - A step’s
(old: T)parameter. - Observation
Expr - An observation of a capability operation’s recorded calls (v0.117, testing
track slice 5).
cap/opname the seam (Logger.log);matcheris the claim about the recorded calls. - ParStmt
- #2640: a
par { … }block.statementsis what the author wrote between the braces, unvalidated: the checker rejects every form but the effectfulletanddo(bynk.par.invalid_statement), so the editor still sees the rejected statement in place. - Param
- Pattern
Binding - A single binding inside a variant pattern. Two surface forms:
pattern(positional — match the i-th payload field) andfieldName: pattern(named — match the named payload field). The matched sub-patternis a fullPattern(ADR 0169), so a plainnameis aPattern::Binding,_aPattern::Wildcard, andOk(x)a nestedPattern::Variant. - Property
Decl - A
property "name" { for all <bindings> [where <pred>] { body } }block inside a suite (v0.114, testing track slice 2, ADR 0149). The generative sibling ofCase: the runner draws inhabitants of each binding’s type from its refinement domain and evaluates the body’sexpects over them. - Provider
Decl - A provider declaration (v0.5 §3.4). Supplies an implementation for a capability.
- Provider
Op - One operation in a provider (signature plus body).
- Qualified
Name - A dotted name like
fitness.units. - Queue
Variant - One variant of the built-in
QueueResultsum (v0.44). - Record
Body - Body of a record-type declaration (v0.2 §3.1).
- Record
Field - One field of a record type declaration. Each field may carry inline refinement, which is enforced at construction time on the field’s value.
- Recursive
Generic Path - #3192: a recursive generic type reached from some type, and how.
- Refinement
- Refinement
Pred - Removed
Agent Decl removed agent Old(state-migrations S3, #2248): the agent classOldis gone, and its stored data is deleted through anexportstombstone.- Requires
Dep - One
"pkg": "range"entry in a binding’srequires { … }map. - Schema
Dispatch - A
via schema(...)dispatch clause on afrom Events(...)header (Events track, slice 4, spine #936): filters delivery by the envelope’sschemaVersion, parallel toEventPatternbut matched against the envelope rather than the payload, and written after theEvents(...)header’s closing)rather than inside it. Delivery is still deliver-and-filter (unchanged from slice 1’s ADR 0286): the fan-out mechanism delivers every emission to every subscriber regardless, and this becomes one more independently-evaluated runtime guard in the subscriber’s own generated handler — no cross-subscriber ambiguity check (two sibling subscribers with the same or overlapping version coverage are both legal, undiagnosed). - Scheme
Arg - One
key = valueargument in a scheme config (Scheme(key = value, …)). - Security
Field - One
name: valuefield inside asecurity { }policy (v0.141). - Security
Policy - A security-headers policy on a
from httpservice (v0.141, ADR 0164): thesecurity { }section in the service body. Parsed leniently as a list ofname: valuefields (an unknown one is a checker diagnostic, per the CORS /@-annotation precedent) and interpreted through the typed accessors below. - Service
Decl - A service declaration (v0.5 §3.5). Services are the boundary interface of a context.
- Snapshot
Clause - #2842: the
matches snapshot "<name>"tail of anexpect.matchesandsnapshotare contextual words, matched by text likefaults. - Store
Field - A
storefield (v0.81, storage track). Each is an access-pattern slot of a declared storage kind:store <name>: <Kind>[…] [@annotations] [= <init>]. The kind and its element type are carried as an ordinaryTypeRef(Cell[Int],Map[K, V]); the checker restricts which heads are storage kinds. Access-pattern annotations (@indexed, …) parse intoannotations(v0.85, ADR 0111); the checker validates them against the closed registry. - Store
Kind - A storage kind applied to its element type(s) (v0.81):
Cell[Int],Map[ReservationId, Reservation]. Theheadis the kind name (Cell,Map,Set,Log,Queue,Cache); the checker validates it against the closed catalogue. Element types are ordinaryTypeRefs. Refined element types (Cell[Int where NonNegative]) ride a later slice (parse_type_ref does not yet accept an inline refinement in type-argument position). - Stub
Clause - v0.118: a per-seam provider override
stub Cap.method(<args>) returns <v> | fails(testing track slice 6, ADR 0154; keywordstubsince #548). Substitutes one capability method’s provision under test; the right-hand side is a value or a fault, never a computed body. - Suite
Decl - A
test <qualified-name> { ... }declaration (v0.7 §3.1). - SumBody
- Body of a sum-type declaration (v0.2 §3.2).
- Transition
- An agent step invariant (v0.116 §, testing track slice 4). A named predicate
over the pair of committed states — the pre-commit
oldand the proposednew, each the agent’s state record — that must hold of every state move; a commit that would violate it faults (InvariantViolation) before the state is persisted, exactly as a snapshotInvariantdoes. Widens the invariant subject from a snapshot to a step (ADR 0144 — one predicate surface); the predicate reuses the invariant surface (implies/is/pure methods) withold/newbound contextually (old.status is Paid implies new.status is Paid). - Trivia
- Comment trivia attached to a declaration or statement (v1.1 LSP spec §3.5). The parser collects line comments from the token stream and attaches them to nearby AST nodes so the formatter can re-emit them.
- Type
Decl - Type
Param - A function type parameter (v0.20a,
fn name[A, B](…)). A struct rather than a bare Ident so the ADR-0028 “bound-capable” promise is a later field addition, not a representation change. - Uses
Decl - A
uses other.commonsdeclaration (v0.3 §3.3). - Variant
- One variant of a sum type. Variants may have payload fields; a payload-less variant is a simple tag.
- Variant
Field - One payload field of a sum variant. Variant payload fields use named declarations like record fields, but do not carry refinement in v0.2.
- Where
Bound - One
A: C1 + C2entry of a method’swhereclause (constrained-generics slice 0): bounds a type parameter the method does not declare itself — the receiver type’s (fn Box.has(self, x: A) -> Bool where A: Eq).
Enums§
- ArgPattern
- v0.118: one argument pattern in a
stubcall pattern. Patterns for the same method are tried top-to-bottom, first match wins. - Base
Type - BinOp
- Branching
- A branching expression, as
ExprKind::branchingreads it. - Chain
Link - One link of a plain access chain, as
ExprKind::chain_linkreads it. - Comment
- One entry of comment trivia.
- Commons
Form - The two surface forms in which a commons body may be parsed (v0.3 §3.1).
- Commons
Item - DocForm
- #1888: which of the two doc forms a
Docwas written in. - Duration
Unit - A
Durationliteral unit (v0.86, ADR 0112) — the closed set of suffixes in a<int>.<unit>literal. Each maps to a fixed millisecond factor (Durationerases toIntmilliseconds). - Event
Pattern Value - The value a pattern field is matched against. A closed set, mirroring
Pattern::Literal’s closed literal kinds plus a nullary sum-variant reference — no nested record sub-patterns in v1 (slice 1 filters on top-level fields only). - Export
Kind - What an
exportsclause exposes: types (with a visibility) or, v0.15, capabilities offered for cross-context consumption. - Expr
Kind - FnName
- A function-declaration name: either a free function
for a methodT.method(v0.2 §3.6). - Handler
Kind Hash(P8.5, #1516): aHandlerKindvalue is a body-free, span-free discriminant, added so aDefId-keyed handler identity could carry it (bynk-check’s formerqueries::HandlerDefId, deleted by #1537 — kept here because the derive is harmless, and a rebuild against ADR 0417’s shape would need it again). Purely additive; no existing caller matches on hashing behaviour.- Http
Method - HTTP methods supported by
on httphandlers (v0.9). - Http
Variant Payload - Payload shape of an
HttpResult[T]variant (v0.9 §3.3). - Interp
Part - One part of an interpolated string (v0.43, ADR 0075). An
ExprKind::InterpStrholds an alternating run of these. - Json
Options - How an
Optionis written in an HTTP response body (#2858). - LetElse
Form - #2010: the spellings of a
let … elsefallback (and, #2654, its absence). - Literal
Value - The value carried by a
Pattern::Literal. A closed set (ADR 0001): integer, string, and boolean. Kept distinct fromExprKindso patterns carry only what they can actually match, and so it isEq/Hashfor the duplicate-arm check. - Match
Body - The right-hand side of a match arm — either a single expression or a block.
- Migrate
Item - One item of a migration step’s body.
- Observation
Matcher - The claim an
ObservationExprmakes about a seam’s recorded calls (v0.117). - Pattern
- A pattern (v0.2 §3.8). Patterns appear in
matcharms and as the right-hand side of theisoperator. - Pattern
Binding Kind - Pred
Kind - Queue
Variant Payload - Payload shape of a
QueueResultvariant (v0.44). Non-generic — a verdict carries no value;Retrycarries aStringreason for the log path. - Refinable
Literal - A literal
ExprKind::refinable_literalreads: its data, borrowed from the expression. - Rounding
Mode - A
Decimalrounding mode (#2622) — the closed setround/divaccept. WrittenRoundingMode.HalfEven; read syntactically at that argument (it is not a first-class value in this slice), so it lowers to its name. - Schema
Version Pattern - The pattern a
via schema(...)clause matchesenv.schemaVersionagainst: a literal, an inclusive integer range, or_. Mirrors@schema(N)’s own permissive-parse-then-checker-validate split (a non-positive bound is a checker error, not a parse error, for the same diagnostic style). The range is the sameIntRangea match pattern uses (events slice 4b, #990, with patterns slice 5, #2699). - Scheme
ArgValue - A scheme config arg value — a string literal, an integer, a duration
literal (
12.hours, #3386) or a bare identifier (sameSite = Lax, #3386). - SeqOutcome
- v0.118: one outcome in a sequenced (
returns each)stub. - Service
Protocol - The protocol a service conforms to — declared on the header via
from <protocol>(v0.44).Callis the default (nofromclause): a contract-mediated internal-RPC surface, not a wire protocol. Multi-endpoint protocols (Http,Cron) carry no binding — the endpoint lives on each handler; single-bindingQueuecarries its queue name. - Source
Unit - Either a commons or a context — the two declaration kinds at the file level (v0.4 §3.1). v0.7 adds the test declaration kind; v0.17 the adapter.
- Statement
- Block-level statement.
- StubRhs
- v0.118: the right-hand side of a
stubclause. - Test
Tier - v0.118: the tier a
caseruns at (testing track slice 6, ADR 0153). One body promoted across the testing pyramid;unitis the default and elided. - Type
Body - The right-hand side of a
typedeclaration. In v0/v0.1 only theRefinedvariant existed; v0.2 adds records and sums; v0.3 adds opaque. - TypeRef
- UnaryOp
- Unit
Form - Which spelling of a
DurationUnita literal used:hourorhours. - Visibility
- Visibility level for an exports clause (v0.4 §3.3).
Constants§
- AUTHOR_
CHOSEN_ STATUS - The
statusof anHttpVariantwhose status is chosen per construction (RawError, #2341) rather than fixed by the variant. - DEFAULT_
MAX_ PARTS - #3276: the parts a
@multipartrequest may carry when nomaxPartssays otherwise. - HTTP_
VARIANTS - All
HttpResult[T]variants, in declaration order (ascending status). The vocabulary tracks the common, modern HTTP status codes (RFC 9110): success and created/accepted (Value), redirects carrying aLocationURL, and the client/server failures that handlers routinely return (Messagewhen an explanation helps the caller,Nonefor self-describing statuses). - LAMBDA_
ARG_ BINDER_ PREFIX - #2712: the prefix of every hidden lambda-parameter binder. See
LambdaParam::pattern; likeLET_ELSE_BINDER_PREFIXit cannot collide with a user identifier. - LAMBDA_
WILDCARD_ PREFIX - #2896: the prefix of the hidden name a wildcard lambda parameter (
_) is given —__wild<offset>, with an empty span at the_. The parameter takes its type from the expected function type like a named one; the unique name keeps(_, _) => …from emitting duplicate TS identifiers, and no user identifier can spell it, so nothing in the body can refer to it. - LET_
ELSE_ BINDER_ PREFIX - #2010: the prefix of every hidden
let … elsebinding. User identifiers start with a letter (the lexer’sIdentrule), so no user name can collide with it, and the emitter already treats__-prefixed names as its own. - QUEUE_
VARIANTS - All
QueueResultvariants, in declaration order.Ackconfirms the message;Retryredelivers it, carrying a reason for observability.
Functions§
- effective_
json_ options - The mode a route’s response body is written in: its own
@json(options:)wins over the service’sjson { options: }, which wins over the tagged default. - error_
status - The status an
ErrorStatusname stands for inRawError’s first argument (#2341, L4): one of the vocabulary’s own 4xx/5xx variant names (Forbidden→ 403).Nonefor any other name. - expr_
children - Every directly-nested sub-expression of
e— the total child iterator. The match is exhaustive (no_arm), so adding anExprKindvariant is a compile error here rather than a silently incomplete walk — the trap the checker’s three hand-rolled partial walkers each fell into (block statements and match-arm bodies were skipped, so e.g. the:=self-reference rule was bypassable through a match arm). - generic_
record_ is_ recursive - v0.174 (#592): does the generic record type
nametransitively contain a reference to itself — through any field-type path, including collection andOptionwrappers, sum-variant payloads, and generic type arguments? Such a type has no finite set of monomorphised boundary codecs: uniform recursion (Node[T] = { next: Option[Node[T]] }) would need a self-referential codec chain the per-instantiation model does not yet generate, and polymorphic recursion (Weird[T] = { next: Option[Weird[List[T]]] }) an unbounded set of instantiations. A recursive generic declares and works in memory; it is refused only where a codec is required (bynk.generics.recursive_generic_at_boundary, found byrecursive_generic_path), and polymorphic recursion is refused at its declaration (bynk.generics.polymorphic_recursion, found bypolymorphic_recursion_edges). - http_
variant - Find an
HttpResult[T]variant by name. Returns the variant info orNoneif the name doesn’t match. - in_
check_ order - #1651: the order a refinement’s predicates are checked in at runtime:
every
Matchesafter every other predicate, and otherwise source order. - is_
generated_ binding - #2010: whether
nameis a binding the compiler generated rather than one the author wrote. Editor surfaces (inlay hints, locals, symbols) skip these. - is_
iso_ date - #2867: is
sexactlyYYYY-MM-DDand a date that exists? The one compile-time statement of the ruleIsoDateenforces; the runtime’s__bynkIsIsoDate(bynk-emit/runtime/src/time.ts) is its TypeScript twin and shares the calendar withInstant.fromIso. - is_
media_ type - Whether
sis a media type a@raw(contentType:)may declare:type/subtypeof RFC 7230 token characters, or the wildcard*/*. Parameters (; charset=…) are not part of the declaration. - of_
is_ total - #3946: whether
T.of(value)is total, returningTrather thanResult[T, ValidationError]. True for a named type (type Id = Int): not opaque, and a refinement with no predicates (annotations alone are not a predicate).Floatis the exception: its finite-number check is part of the type (ADR 0040), so aFloatnamed type stays fallible. - polymorphic_
recursion_ edges - #3192: the recursive edges of generic type
declthat are not uniform, as(callee, span). A recursive edge is an application, in the body, of a generic that reachesdeclagain (declitself, or a mutually recursive partner); it is uniform when its arguments are exactlydecl’s own type parameters, in order. Anything else (Weird[List[T]]insideWeird[T],Pair[B, A]insidePair[A, B]) is polymorphic recursion, which generates an unbounded set of instantiations and is refused at the declaration (bynk.generics.polymorphic_recursion). Conservative by design. - queue_
variant - Find a
QueueResultvariant by name. - raw_
error_ status - #2341 (L4): the status a
RawError’s first argument names — a bare 4xx/5xx variant name (Forbidden) or one qualified byErrorStatus(ErrorStatus.Forbidden).Nonefor any other expression. - recursive_
generic_ path - #3192: where
treaches an application of a recursive generic type (generic_record_is_recursive), as the field chain it is reached through. A recursive generic declares and works in memory but has no codec yet, so every position that serialises uses this walk. It follows named and applied types into their declarations, asstream_pathdoes, so a record that merely containsTree[Int]is found where the record is used. It does not enter a function type, which is refused at a boundary on its own. Terminates via thevisitedset. - rounding_
mode - #2622: the rounding mode a
Decimalround/divargument names —RoundingMode.HalfEven.Nonefor any other expression. - statement_
exprs - The expressions directly contained in a statement — the statement half of
expr_children’s total walk. Exhaustive overStatementfor the same reason, and over each statement’s expressions: alet’s call-site principal identity included. - stream_
path - K-streams (#2623): where
treaches aStream, as the chain of fields it is reached through (["Bundle.download", "Download.body"]), orNone. A bareStream(or one inside a wrapper) is the empty chain. A record or sum may carry a stream; such a type is then non-boundary like the stream itself, and this is the walk every boundary check uses to find it. It follows named and applied types into their declarations (a generic record’s own fields too, soWrap[T] = { s: Stream[T] }is found throughWrap[Int]), but not into a function type, which is rejected at a boundary on its own. Terminates via thevisitedset. - type_
carries_ stream - K-streams (#2623): whether the named type
namecarries aStreamin a field, at any depth (stream_path). Such a type has no codec.