pub enum Effect {
}Expand description
An effect atom. §3.2’s list, with the one correction Phase 2 makes to it (see Effect::Nondet).
Variants§
Ingress
A merge point: arbitrary interleaving. “there is exactly one of these” (§3.7).
Durable
A persistent accumulator — the log.
Dom
Touches the document.
Nondet
Reads a clock, a random source, or mints an id.
§3.2 files time and rand under the ambient set — “implicitly available outside folds
and elided from signatures”. Phase 2 does not, and the reason is §3.3’s own table: the fold
engine is a tier, and whether a tier can discharge time and randomness is precisely
§3.7’s determinism rule. An effect that decides a placement cannot also be elided from the
signature that placement is derived from. log and metrics stay ambient
(Effect::Ambient); these do not.
NetOut(Arc<str>)
net.out(host) — an outbound call to a named host. The host is what
docs/06-kubernetes-and-packaging.md
§6.5 turns into a NetworkPolicy peer.
NetIn
net.in — accepts inbound connections.
FsRead(Arc<str>)
fs.read(path) and fs.write(path) — two atoms for one resource.
§3.2 listed a single fs(path) until docs/81.
One atom naming a resource without saying what is done to it cannot answer the two questions
that are actually asked of it: whether two things may happen at once
(crate::check’s parallel: rule) and whether a mount needs to be writable
(docs/06 §6.5). §3.8’s escape
hatches were already two — Effect::ExternalRead and Effect::ExternalWrite — and
this is the same split for the same reason.
FsWrite(Arc<str>)
Env
Reads process environment.
Spawn
Starts concurrent work.
Cap(Arc<str>)
cap.X — a capability the caller must hold. §3.5: “forgetting an auth check means the
cap.* effect goes undischarged — a compile error, not a pentest finding”.
Partial
May diverge or panic.
Raises(Arc<str>)
raises(E) — this may fail with a value of the named type.
An error is a row label, not a mechanism: a signature without one provably cannot fail,
and Result[T, E] is the reified form a handler produces rather than a parallel channel
(docs/38 §38.4, adopting Koka’s exn). The
atom names the error’s type because a handler has to say what it catches — a try that
caught everything would turn a caller’s unknown failure into this one’s Result.
ExternalRead(Arc<str>)
§3.8’s escape hatches: an existing store the team already has.
ExternalWrite(Arc<str>)
Ambient(Ambient)
The ambient set that survives §3.2’s description: available everywhere, elided from signatures, and never a reason to place anything.
Implementations§
Source§impl Effect
impl Effect
Source§impl Effect
impl Effect
Sourcepub fn breaks_replay(&self) -> bool
pub fn breaks_replay(&self) -> bool
Does this effect make a fold a different function of the log? §3.7’s replay-purity rule, stated as a property of the atom rather than as “the row is empty”.
log and metrics do not (they are write-only observations, §19.8), partial does not
(a fold that aborts produces no state, rather than a different one), and raises does not
(the same value raised for the same input, every replay). Everything else does.