Home / Docs / Specification
07. Information flow
Status: Normative, v0.1.
1. Guarantee and scope
Una enforces termination-insensitive noninterference up to declassification (theorem T6, spec/10 §6): for any observer at label l, two runs whose inputs differ only in values labeled above l produce the same values and effects observable at l, unless a declassification policy released information to l.
Observable channels in the model: return values, failure variants and payloads, capability operation arguments, the occurrence of effects.
Outside the model in v0.1, and reported as such in the build report (spec/13 §6, out_of_model): timing, termination and divergence, resource consumption and allocation, stack exhaustion, external systems beyond declared signatures, races between the check and the use of a file path, hard links, order of effects across concurrent tasks, the time of a host stop, interference of the host's load with the timing of an expression, uncatchable termination, waits at limits and at start, and which branch of first of wins, beyond its label (spec/14 §3 and ADR 0048 for hard links; v0.2, ADR 0065 and spec/19 §3 for the order of effects, which includes how far a canceled task got; edition 0.4 preview, ADR 0116 rule 21 and spec/26 §6 for the time of a host stop, the interference of the host's load and uncatchable termination, and ADR 0117 rule 13 and spec/27 §6, §7 and §9 for the waits at start and at the limits of grants, and the winner of first of). T6 holds for the result of a together block and for each task's own events. A run-time abort is termination: running out of depth or memory (U6003), in v0.2 a header value with a control character (U6004), and host text that is not valid UTF-8 (U6005, S-16, ADR 0086).
2. Labels
A label is a pair (level, categories).
- Levels, in order:
public⊏internal⊏confidential⊏secret⊏restricted. - Categories are declared per package in
una.tomlunder[labels] categories. An undeclared category is U4007. - Order:
(l1, C1) ⊑ (l2, C2)iffl1 ≤ l2andC1 ⊆ C2. Join is componentwise (max level, union of categories). - Bottom
⊥ = publicwith no categories. Top⊤ = restrictedwith all declared categories.
Syntax: secret[PII] Phone, confidential[Location, PII] Report, internal Hashed. No prefix means public. (v0.3, ADR 0094.) The same label syntax follows gives after an operation in a header's uses (spec/05 §3 rule 6): a principal on whose behalf the operation answers is a category.
3. Typing rules (informal; formal rules in spec/10)
-
Explicit flows. The label of an operation's result is the join of its operands' labels. Field access joins the record's label with the field's declared label. (v0.3, ADR 0094 rule 2.) The answer of a capability operation through a binding whose header gives it a label
l(spec/05 §3 rule 6) carriesl, and so does the decision on whether it fails; the rule is stated in §7 rule 4, its last paragraph, where ADR 0094's amendment of this section lives. -
Program-counter label. Branching (
if,when,if none) on a value labeledlraises the pc topc ⊔ linside the branches. Values produced inside the branches are joined with the raised pc.unalet flag = if r.age > 17 then 1 else 0 -- r.age : secret[PII] Int -- flag : secret[PII] Int -
Failures under pc.
failand handling clauses that fail are allowed only whenpc = public(U4002). Code that must branch on labeled data returns a labeled value instead of failing. -
Effects under pc. A capability operation under pc requires
pc ⊔ label(args) ⊑ accepts(U4003). A call to a function is allowed under pc only ifpc ⊑ bound(f), wherebound(f)is the meet of theacceptslabels of all effectsfmay perform, andpubliciffcan fail (U4002). Pure, non-failing functions havebound = ⊤. A call of a function value labeledl_fis a call underpc ⊔ l_f, and its result is raised byl_f(T-App, spec/10 §5). -
Returns. A function body's result label MUST be ⊑ the label of the declared return type (U4001).
4. Sinks
Every capability operation argument is a sink with the operation's accepts label (default public). Host capability sinks are fixed in spec/14 §3 (for example, Console.print accepts public).
Text interpolation propagates labels: "id {phone}" has the label of phone. Printing it through Console is then U4003.
(S-45, #1552, ADR 0032 amendment of 2026-11-06.) A run's trace is a sink that accepts public, in every edition this compiler accepts: each item of an event is rendered at its label, an argument at its static label and an outcome at the label of the operation's decision, failure type and result (spec/11 §5), and whether an event occurs at all follows spec/26 §6 rule 4. An example's trace is the exception: its data come from its source (ADR 0078).
expect lines in examples (tests, written test in edition 0.3, spec/08 §2, ADR 0105) observe values for the test harness and are exempt from sink checks.
5. Declassification policies
Labels are lowered only through a policy declared in a trusted module.
trusted module events.keys
import events.types (Phone)
pub policy attendee_key
from secret[PII] Phone
to internal Hashed
via hmac_phone
purpose "attendee lookup and audit correlation"
owner privacy
hmac_phone(phone: secret[PII] Phone) -> internal Hashed
uses @keys: Keys[hmac]
fails KeyError
=
@keys.hmac(key_name: "phone_pepper", data: phone)
if error pass- A policy
pdefines a callablep(v: From) -> Towhoseusesandfailsare those of itsviafunction. - At a call
p(v):vflows intoFromby normal subtyping, andpc ⊑ label(To)(U4002). - The
viafunction MUST be private to the trusted module (U4005): the policy is the only entry point. Insideviafunctions, information-flow checks are not performed; they are part of the TCB, with one exception in edition0.4, the concurrent label of their timing sites (rule 7). Only label premises are skipped: every refinement, precondition and postcondition obligation remains, including the obligation that the result of theviafunction satisfies the refinement of thetotype (ADR 0038 D5). T-Declassify assumes that refinement only because it was proven there. - Types other than labels MUST match between the policy and its
viafunction (U4005): the parameter type of theviafunction equalsfromexcept for labels, refinements included, and its result equalstoexcept for labels, so a refined kind in one and not the other, or two different refined kinds, is U4005 atvia. Aviafunction MUST NOT have arequiresclause (U4005 at the clause): a policy call checks its argument againstfromonly, so the argument meets every assumption theviabody makes about its parameter (ADR 0047). - Every policy call site appears in the build report's Information section with the policy name, purpose and owner.
- (ADR 0090, S-18.) The failure of a policy call is labeled
pc ⊔ ℓ(To), where its release is visible: theviafunction decides it from thefromvalue, unchecked (rule 3).attempt p(v)gives aResultwith that label, andif error passandif error failare U4002 when it is abovepublic. A policy whoseToispublickeeps a public failure. (ADR 0098.) Aviafunction whose only failure points areKeys.hmaccalls with a literal key name, at the top level of its body and handled byif error passorif error failwithout a payload, decides nothing from thefromvalue: its policy's failure is labeledpc(spec/10 §13.4). - (v0.4, ADR 0098, amendment of 2026-11-06.) The timing sites of a
viafunction. A deadline or race outcome may reach the result of aviafunction only if its concurrent label ispublic: the site'sτ_conc, as each site's timing label defines it (spec/26 §7 rule 5 item 5, spec/27 §5 rule 8, §6 and §10), computed today by the preview's rule of spec/27 §11 (its first paragraph), even at the sites whose timing label already takes the preciseτ_concof spec/27 §11; the precise rule (conc(n) ⊔ ctx(e)) is lower and is not used here until a card adopts it (#1087), and either is what the program's other work, running beside the site, can make of its timing. The residue labelL_resis not part of it; a stricter definition that joinsL_resis not part of this rule. Since no label is checked inside aviabody (rule 3), every outcome of a timing site that the body reaches counts as reaching the result. So eachwithin(spec/27 §5,start ... withinincluded),first of(spec/27 §6),for ever within(spec/26 §7) and statement that an installation oflimiterscopes over (spec/27 §10), in aviabody or in code it reaches along the call graph of ADR 0116 P1, with the edge of each policy call to itsviafunction, is U4001 at the site when its concurrent label is abovepublic. The other items of the site's timing label are thevia's own data and stay unchecked. Aviawith a timing site is therefore accepted for a policy called where no part of a task construct can run beside it, as the conformance casesecurity/via_hmac_within, except where a function value can come from outside the code it reaches, below, and refused where a part that reads data abovepubliccan run beside it. The concurrent label checked is the preview'sτ_concof spec/27 §11 until the precise one lands. The code aviabody reaches counts each lambda with the function or handler it is written in. A function value that aviabody, or code it reaches, calls or applies (a function given tomapby name, say) is one of the lambdas written in that code or one of the functions it names as values, which the reach follows from where they are written, unless a value can come from outside that code (#1710): a parameter of theviawhose type can hold a function value, the answer of an operation it reaches that can hold one, a handler it reaches whose parameters can hold one or whose operations call a function value, since its parameters and state come from whoever installed it, or a function it reaches outside the findings (a standard module but the one named exactlyprelude, soprelude.mapandstd.collectionsincluded, whose type parameters can hold one, or a dependency not checked with the package) whose parameters or result can hold one. Only then does the call graph's one node for all lambdas count: every lambda's code and every function named as a value count as reached, and their timing sites are checked against this rule wherever the policy is called (security/via_result_handler_value); otherwise they do not (security/via_result_value_call). This takes a second search of the graph only when such a source is reached, and one look at each node the first search reaches with a table of what each operation answers built once, O(V + O log O) for the O operations (tests/via_reach_scaling.rsofuna-check). A site already refused with U4001 at its own span, as alimiterthat can run beside other tasks always is by spec/27 §10, gets that one diagnostic. The check is one search of the call graph from everyviafunction at once, O(V log F + E + A log A) forAapplications of functions whose code is not known at the call, and O(log n) per site, with a scan of the diagnostics so far for each site it refuses. No released line has timing sites. (ADR 0116 amendment of 2026-11-09, accepted, C7, #898.) A reading ofClock.nowthat aviabody reaches in the same way is U4001 at the reading when its timing labelL_clk(spec/14 §3) is abovepublic, all of it and not only its concurrent label, since that label is the timing of the policy's callers, not thevia's own data.
6. Trusted modules
A module is trusted only if its header says trusted module and it is listed in una.toml under [trusted] modules (U7005 if either is missing). Policies are allowed only in trusted modules (U4004). All other code in a trusted module is checked normally. Trusted modules and their line counts are listed in the TCB section of the build report.
(v0.3, ADR 0093 rule 8.) A boundary module (spec/05 §4 rule 5) never releases: it is never trusted (U7002, spec/13 §7), and a call into a boundary from which a policy call is reachable is U3024 at the call, with the policy call as the related span. Reachability follows the call graph: the callee's body, the functions it calls, the handlers it installs or receives, and the function values and lambdas given to it. A function value given to the boundary whose code is not known at the call, from a parameter, a local, a computed value or a kind's field, either as an argument or captured by a lambda given to it, is U3024 at the call, with the value as the related span, unless no policy is declared in the package or the modules it imports: then nothing releases. A named function and a lambda are followed, together with the handlers that their uses resolve to where they are written, which they run on whoever calls them; a binding captured by a lambda written outside the call is not followed, so such a value counts as one whose code is not known. What the arguments of a handler's installation give it, the handler may run wherever it is installed: the named functions and lambdas among them are followed from the handler, and a function value whose code is not known at the installation counts as above for every call into a boundary that may run the handler. A handler installed outside the call and granted on to it by name (spec/05 §4 rule 5) is followed from its installation: a release it reaches is U3024 at the installation, with the release and the call as related spans, and so is a function value whose code is not known that it may run, when a policy is declared.
7. Checking
These rules fix how the checker applies this chapter and spec/10 (ADR 0031).
- Structural labels. Every position of a type carries a label, and an unlabeled position is
public(spec/03 §5, spec/09 §2). Type equality ignores labels. A type variable keeps the join of the labels of every type it is unified with, so an instantiation of a generic function or kind carries the labels of all its arguments. - Flows. A value flows into a declared type at a call argument, an operation argument (rule 4), a constructor field, an annotated
let, a return path, thefromtype of a policy and a lambda's result. The flow holds when every position of the value's type is labeled below the declared label at that position: covariantly throughListand the covariant parameters of kinds, since values are immutable, contravariantly through function parameters (S-Refine, S-Fun), and with equal labels at every position of an argument of an invariant parameter of a kind (ADR 0046). A type parameter of a record or sum kind is invariant when it occurs anywhere inside a function type in the types of the kind's fields and variant fields, as a parameter or a result, or under an invariant parameter of another kind; otherwise it is covariant, as the parameters ofOptionandResultare. Recursive and mutually recursive kinds take the least solution. A branch join and a list literal are flow sites too: each branch ofif,when,if none useandif error use, and each element of a list literal, flows into the joined type. Otherwise it is U4001 at the value. The arguments of one call are compared after all of them are typed. A lambda's type records the labels its body assumed for its parameters, so a parameter whose type variable rises after the body was checked, like the accumulator offoldover labeled values started from apublicvalue, fails the flow of the lambda into its parameter. AUnitposition carries no information and never fails a flow. In a return position,if,whenandif nonewhose condition, scrutinee or option is labeled above the result's top label are U4001 at that condition, once per construct. (v0.4, ADR 0073 J5 as amended on 2026-11-09, accepted on 2026-11-10.) In edition0.4and later, the arguments of a constructor of the prelude kindJsonare the one exception among constructor fields: they do not flow into the fields' declared labels, and the result's top label carries every label they hold instead (spec/23 §5 rule 2). - Labels of values. Literals are
public. The result of an arithmetic, logical or comparison operator, an equality and an interpolation is labeled with the join of every label of its operands' types. The labels of a kind's type include the labels that its fields and variant fields declare, instantiated with its type arguments and through the kinds they contain, so==on a record with asecretfield issecret, and so is an interpolation of it (v0.2, ADR 0068), whichConsolethen rejects (U4003); the same deep label bounds sinks and labels the results of generic calls and prelude functions (rule 8)..len,isandintake the top label of their operand. That holds because a pattern's literal is a constant, and so ispublic: a text literal with interpolation in a pattern, anisof awhenarm or of an expression, MUST be rejected with U4008, in every edition, since its text is computed from the values it interpolates (S-28, #801). A field access and a pattern binding take the field's declared type, instantiated, with its top label raised by the top label of the record or the scrutinee. The value ofif,whenandif none useis raised by the top label of the condition, scrutinee or option (T-If, T-Case). The result of a call of a function value is raised by the value's label. - Operations. An operation's arguments are sinks:
pc ⊔ ℓ⁺(arg) ⊑ acceptsfor each argument (U4003), whereℓ⁺joins the labels at the covariant positions of the argument's type, the data the caller sends to the handler: the top label, list elements, the arguments of covariant kind parameters with the labels their kinds' fields declare, function results, and the parameters of function parameters; every label of an argument of an invariant kind parameter counts (ADR 0052). Each argument also flows (rule 2) into the operation's declared parameter type with every covariant position of that type taken as⊤, so the labels declared there do not bound the data the caller sends, whichacceptsbounds, sinceacceptswould otherwise never exceed them (Files.writeacceptsinternalcontent declaredText, spec/14 §3); contravariant positions, such as the parameters of a function type, and every position of an argument of an invariant kind parameter are compared as at any other call argument, since a handler body assumes them (U4001, ADR 0050). An inline lambda given as an operation argument is typed against the declared parameter type, as a lambda is against any expected type (spec/03 §7), so its result flows into the declared result type, labels included (U4001); a function value passed by name, or a lambda first bound withlet, has its own type and is compared as this rule states (ADR 0081). Inside a handler operation body, every label of a parameter's type is raised by the operation'saccepts. The result of an operation keeps its declared label, exceptKeys.hmac(ADR 0039): itskey_nameacceptspublic, itsdataaccepts every label and is not a sink, and its result is labeledinternal ⊔ ℓ*(data); in a handler ofKeys,datacarries every label and the result may carry it (spec/14 §3). (v0.2.) Whether a host operation fails, and how, is labeled by the arguments that decide it, each capped at what the operation accepts, as the failure of a labeled prelude function is: every argument ofHttp(S-15, below); the path ofFiles, not the content; the key name ofKeys.hmac, not the data. Soattemptgives aResultwith that label,if error useruns under it, andif error passandif error failare U4002 when it is abovepublic. SinceFiles.readandKeys.hmacaccept onlypublicfor the arguments that decide them, their failures staypublic, unless the file-state label below raises those ofFiles. (S-15, ADR 0085.) Every argument ofHttpdecides its failure, its body and the values of its headers included: the server receives them all and may decide the failure by them. So the failure of every request isinternal, as its response is, sinceHeaderdeclares its valueinternal. (S-14, ADR 0085.) The file system outlives the call that writes it: where aFiles.writelands decides which laterFilesoperations fail, in the same run and in later runs of the package. So the failure of everyFiles.readandFiles.writeis also labeled by the package's file-state label. That label is the join, over every call ofFiles.writein the package, of three labels: its path's labels, the program counter at the call, and the highest program counter its code can be entered under. That last label is, for a function, the join of the program counters of its direct calls, each raised by its caller's own, over the call graph; for a function used as a value or a policy'sviafunction, which may be called anywhere, the effect bound of rule 4, orpublicwhen it can fail; the effect floor for a handler operation;internalinside a lambda; andpublicin an example. It is capped atinternal, whichFiles.writeaccepts at most for its path, so a higher path is U4003 and a higher program counter U4002 already. What a write writes is not part of it: it decides nothing that a later operation observes but resource consumption, which is outside the model (§1), and a later read returns itinternalanyway. Writes by other programs or people are outside the model too (§1). (v0.3, ADR 0094 rule 2.) Through a binding whose header gives the operation a labell(spec/05 §3 rule 6), the operation's answer carrieslat every position of its result type, and the label of whether it fails, and of its payload, is joined withl: the decision on the outcome runs underpc ⊔ l, and a failure passed on, byif error pass, by afailunder the decision or as the function's own failure, is U4002 where it is observed belowl, as any failure under a raised program counter is (S-18, ADR 0090).- Effect floor (ADR 0038 D4). A handler operation body is checked for the worst caller T-Op allows, whose program counter and arguments reach the operation's
acceptslabell_o. Every capability operation performed in the body satisfiesl_o ⊔ pc ⊔ ℓ(args) ⊑ acceptsof that operation (U4003), and every call in the body satisfiesl_o ⊔ pc ⊑ bound_eff(f)(U4002), wherebound_eff(f)is the meet of theacceptslabels of the effectsfmay perform,⊤if it performs none. - Failures and results follow ordinary data flow: the body starts at
pc = ⊥for failure checks, so a callee that can fail is checked against its fullbound(f)at the body's own program counter, and the result flows into the operation's declared return type (U4001). The caller receives both at its own program counter, so they reveal nothing beyond the data that flows into them.
- Effect floor (ADR 0038 D4). A handler operation body is checked for the worst caller T-Op allows, whose program counter and arguments reach the operation's
- Policies. A policy in a module whose header does not say
trustedis U4004 at its name; a header that saystrustedwithout the listing inuna.tomlis U7005 only. Theviafunction is a private function of the policy's module whose one parameter has the type offromand whose result has the type ofto, except for labels and with the same refinements (U4005 atvia), and which has norequiresclause (U4005 at the clause, ADR 0047); any use of aviafunction other than through its policy is U4005. Insideviafunctions no label is checked (§5 rule 3, spec/10 §9 rule 3). - Exemptions.
expectlines of examples (§4), the bodies ofviafunctions and clauses (requires,ensures,where, in the refinement language, whose labels the verifier erases) are not checked for labels.dolines are checked atpc = ⊥. - Categories. A category in a type's label or an
acceptsclause that[labels] categoriesdoes not declare is U4007 at the category; a single file declares no category. - Generics (ADR 0038 D3).
- Type arguments carry their labels. Instantiating
Twithsecret[PII] Phonebinds the whole labeled type, and unification never drops a label. - Symbolic labels. In the body of a generic function, a value of a type parameter
Thas the symbolic labelℓ_T. A result derived from it, by a comparison, an equality, a field, arithmetic, an interpolation or a collection operation of spec/14 §1, carriesℓ_Tjoined with the labels of its other operands, by rule 3. A symbolic label is below a declared label only if the declared label is⊤or contains the same symbolic label, so a value labeledℓ_Tflows into a non-generic parameter, a field, an annotatedletor a sink only where such a value is allowed whateverTis (U4001, U4003). The declared result type of a generic function is the exception: its value MAY carry the symbolic labels of the function's type parameters, and at each call they are replaced by the join of every label of the type that instantiates the parameter (spec/10 §5, generic instantiation). ℓ_Tonly in place (#440). A plainℓ_Tlabels only a position of typeT, where it stands for the labels the value ofTwas passed with; at every other position a symbolic label ofTisℓ*_T. Substitution readsℓ_Tat a position of typeTas the type argument's own labels, so anℓ_Tjoined there from elsewhere, such as a condition labeledℓ_T, would be dropped. The checker keeps this by construction, and the Core IR it exports keeps it too (spec/13 §8).- (v0.2, ADR 0066.) A comparison or
to_int()on a constrained type parameter is labeled by the same rule, andsortlabels every position with the join of all its elements and of the list (spec/20 §4). - (v0.2, ADR 0067.) Result summaries. In edition
0.2, the call of a generic function declared outside the prelude raises only the positions of its result that can carry each symbolic label:- Two symbolic labels. In edition
0.2, and in edition0.1since #354, the body tellsℓ_T, the label of a value ofTas it was passed in, fromℓ*_T, every label ofT's type argument. A comparison, an equality, a field or another operator overTvalues, a condition on them, and every label that a deep join collects giveℓ*_T(rule 3); a value ofTitself carriesℓ_T, andℓ_T ⊑ ℓ*_T. For a parameter constrained byOrdorInteger, whose type arguments are scalars, the two are the same, and the value carriesℓ*_T. - The positions of a declared result type are its top, a list's element, each type argument of
Option,Resultor a kind, and the result of a function type, recursively. At a position that is a type parameterT,ℓ_Tis the type argument's own labels, which substitution puts there, so the summary leaves it out;ℓ*_Tthere, as when a comparison ofTvalues chooses whichTvalue is returned, is in the summary. - Decisions given to functions. A function value called with an argument that carries
ℓ*_Tcannot be checked against it, since its parameter type saysℓ_T: the decision raises the call's result and its program counter instead, as the label of the value does (spec/10 §5, T-App). When the function is a parameter that anofclause names, its effects are its callers': each caller runs its argument underℓ*(σ(T))for the decisions that reach the parameter's calls, asfirst_whereruns its predicate (rule 9). - The summary $S_f(p)$ of a function $f$ is the set of type parameters whose symbolic labels the body's result carries at position $p$, on any return path, the labels that a raised program counter puts there included.
- Over recursion, the summaries are the least fixpoint over each strongly connected component of the call graph: they start empty and grow until no body changes them.
- A call raises each position $p$ by $\ell^{*}(\sigma(T))$ for each $T \in S_f(p)$ (spec/10 §5). A generic function used as a value does the same once its type arguments are known.
- The summaries are inferred for every function, public ones included;
una contractanduna reportshow them (spec/13 §5,§6). Edition0.1raises every position by every type argument (D-137).
- Two symbolic labels. In edition
- Edition 0.1: decisions given to functions (#253, #346, #350, #354). Edition
0.1tellsℓ*_Tfromℓ_Tin its flows as edition0.2does (the two symbolic labels above; it has no result summaries), so a decided value flowing into an annotationT, a fieldTor a function value's parameterTis U4001 (#354; before, edition0.1readℓ*_Tasℓ_T, and an annotation dropped the decision). The rules below remain, as defense in depth. A function value called with an argument that carriesℓ*_Traises the call's result and its program counter (T-App). A call of a function, the prelude's or a generic one, whose arguments carryℓ*_Tat any position and give it function values whose parameters do not accept it, may reveal the decision through what it returns, through its effects and through its failures, its own or the function values'. So its result is raised by thatℓ*_Tat every position; it runs under that program counter, so its effects and the function values' are bounded by it and it may not fail (T-Call, U4002); and its failure is labeled by it, as an operation's is (rule 4). A function value acceptsℓ*_Tonly when it is a lambda written as the argument itself, inside parentheses or not, none of whose parameters is annotated, and every parameter's type carries thatℓ*_T(its types come from the data, as its body assumes them); every other function value accepts nothing: a named function value, a lambda with an annotated parameter, a lambda bound bylet, wrapped in a branch, a block or a call, or held in a kind's field. This rejects some sound programs, such as a lambda whose annotated parameter receives no decision; write the lambda without annotations, or pass the decision explicitly. So[if a == b then p else q].map(each: k)withk: fn(T) -> Intis labeledℓ_T, and writing it to apublicsink is U4003, andlogger(if a == b then p else q, f: k)withloggerwritingf(x)is U4002; edition0.2rejects these programs at the function argument (U4001). - No effects or failures under a symbolic program counter. Branching on a value whose label contains a symbolic label raises the program counter symbolically. Under such a program counter, capability operations, calls with effects and failures are U4002, because their sink constraint cannot be checked for every instantiation.
- Prelude results. The prelude functions of spec/14 §1 follow the same rule: a result that depends on element or argument values carries their labels. The structural functions put each label at the position that holds it, and the top label of the result only where the shape depends on it; the others label the whole result with the join of every label of their arguments and of their element types (spec/14 §1 "Result labels", ADR 0051).
- Type arguments carry their labels. Instantiating
- Function parameters with
ofclauses (v0.2, ADR 0062).- In the callee. Inside a function whose header names a parameter
pin auses oforfails ofclause, a call ofp, or passingpon, is allowed only under the function's public program counter (U4002 otherwise), since the sinks ofpare not known there. - At the call. The body of a lambda given for such a parameter is checked under the program counter of the call, instead of the public one of a pure lambda (ADR 0031 rule 4).
- The prelude. For the prelude's higher-order functions, that program counter is raised by what decides how often, and whether, the lambda runs:
- the top label of
xsformap,filterandfold, which call it once per element, in order; - for
first_where, also the labels of the elements ofxsand ofkeep's result, since it stops at the first accepted element.
- the top label of
- So
secret_list.map(each: fn(x) -> @console.print("item"))is U4003: the number of lines printed reveals the length.
- In the callee. Inside a function whose header names a parameter
- Sites. U4002 names the condition that raised the program counter as a related location. U4003 points at the argument that exceeds
accepts, or at the operation when the program counter alone exceeds it.