Skip to content

Keywords

Bynk reserves names in three tiers. The first two are lexer keywords; the third are compiler-known type names. Only the hard keywords can never be used as an identifier.

Reserved everywhere — these 60 words can never be used as an identifier.

KeywordMeaning
BoolThe boolean base type.
BytesThe binary base type — an immutable octet sequence, erased to Uint8Array (Bytes.fromUtf8(s)).
DurationThe time-span base type, in milliseconds (5.minutes).
EffectThe effectful-computation type, Effect[T].
ErrThe error variant of Result.
FloatThe floating-point base type.
InstantThe absolute-time base type, in epoch milliseconds (Clock.now()).
IntThe integer base type.
JsonErrorThe JSON-decode error type, Result[T, JsonError] from Json.decode.
NoneThe empty variant of Option.
OkThe success variant of Result.
OptionThe optional-value type, Option[T].
ResultThe success-or-error type, Result[T, E].
SomeThe present variant of Option.
StringThe string base type.
ValidationErrorThe error type returned by a refined type’s .of.
actorDeclare an actor — a boundary contract a handler consumes via by.
adapterDeclare an adapter — the host boundary (capability contract + binding).
agentDeclare a stateful, keyed agent inside a context.
asAlias a consumed context (consumes X as Y).
bindingName an adapter’s TypeScript binding module (binding "<module>").
byName the actor a handler consumes, after the return type — or a service-level default on the header (… -> T by <name>: <Actor>).
capabilityDeclare a capability (a dependency interface) in a context.
commonsDeclare a pure, stateless module of types and functions.
consumesDeclare a dependency on another context’s services.
contextDeclare a deployable context (services, agents, capabilities).
cronThe cron protocol on a service header (from cron).
doPerform a unit effect as a statement (do e — the binder-free let _ <- e).
elseThe alternative branch of an if expression.
ensuresDeclare a function postcondition — a pure Bool clause over the parameters and result (ensures <name>: <pred>).
enumDeclare a payloadless sum type (enum { A, B }).
expectAssert a predicate inside a test case (expect <bool-predicate>).
exportsDeclare which types a context exposes, and how.
falseThe boolean literal false.
fnDeclare a function.
fromName the protocol a service conforms to (service X from http).
givenDeclare the capabilities a handler requires.
httpThe HTTP protocol on a service header (from http).
ifA conditional expression.
impliesLogical implication (P implies Q ≡ `!P
invariantDeclare an agent invariant — a predicate that must hold of every committed state.
isTest a value against a variant pattern, yielding a Bool.
letBind a local value (let x = …, or let x <- … for an effect).
matchPattern-match over a sum type, Result, or Option.
opaqueDeclare an opaque type, or export a type opaquely.
propertyDeclare a generative test inside a suite (property "…" { for all … }).
protocolReserved keyword (protocols are a closed, compiler-known set).
providesProvide an implementation of a capability.
queueThe queue protocol on a service header (from queue("name")).
recordReserved keyword (records are written type X = { … }).
requiresDeclare a function precondition — a pure Bool clause over the parameters (requires <name>: <pred>).
selfThe current agent instance, inside a handler.
serviceDeclare a service (a group of handlers) in a context.
stubStub a consumed capability operation at a test seam (stub Cap.op(…) returns <v> / fails).
transitionDeclare an agent step invariant over the old/new state pair (transition <name>: …).
transparentExport a type with its structure visible (exports transparent { … }).
trueThe boolean literal true.
typeDeclare a type: alias, record, sum, opaque, or refined.
usesBring a commons into scope.
whereAttach refinement predicates to a base type.

Reserved only in the one position named below; elsewhere (a field, parameter, or other identifier) they are ordinary names.

KeywordMeaning
caseDeclare a test case inside a suite (case "…" { … }).
eventDeclare a typed fact a context may emit (event Name = { fields }), inside a context.
messagesDeclare a message bundle for one locale (messages "<tag>" { "code" => "template" }), inside a commons.
onBegin a handler declaration (on call, on GET(…), on message, on open/on close).
suiteDeclare a test suite targeting a unit (suite <target> { case … }).

Compiler-known type constructors. They are not lexer keywords — you may use them as an identifier in value position — but they are reserved in type position: a type declaration may not reuse one of these names (bynk.resolve.reserved_builtin_type).

NameMeaning
ConnectionA held WebSocket connection, Connection[F].
HistoryA generated call-history generator, History[Agent] (test-only).
HttpResultThe HTTP handler result type, HttpResult[T].
ListThe immutable list type, List[T].
MapThe immutable map type, Map[K, V].
QueryThe lazy storage-read type, Query[T].
QueueResultThe queue handler result type (non-generic).
StreamThe value-over-time primitive, Stream[T].