Skip to main content

SeqVerbOp

Enum SeqVerbOp 

Source
pub enum SeqVerbOp {
    Map,
    Filter,
    Fold,
    FilterMap,
    Each,
    MapEach,
}
Expand description

The fn-value verb selected by an Opcode::SeqVerb instruction’s kind byte (docs/stdlib-spec.md §4, issue #1679).

The pure quartet: map, filter, fold, filter_map. Callbacks are pure·silent by the 2026-07-18 ruling, which is what dissolves the eager/lazy question — “one logical pass, order unobservable; the implementation may fuse freely.” Every kind evaluates its callback re-entrantly with output isolated, the SeqSortedBy shape; a callback that yields, presents a choice, calls a host external, or diverges is a turn-terminating fault.

The ruled effectful spellings: each, map_each. Slice 2 of the same issue — deliberately the opposite runtime contract: output reaches the transcript instead of being captured, and the dev-mode world-write guard is disarmed for their callback (docs/stdlib-spec.md §4: “the weird thing gets the ugly method” — friction lives in the name, not in an enforcement gate). Sequential in iteration order, never fused. They are deliberately NOT gated by E119 (brink_analyzer::comparator_contract) — their whole purpose is to be the legal home for the effects the pure quartet’s callbacks may not perform.

Variants§

§

Map

[a, f][a'] — the array of f(x) for each element, in iteration order. f: fn(T): U.

§

Filter

[a, pred][a'] — the elements for which pred(x) is true, in iteration order. pred: fn(T): bool; a non-bool return is a turn-terminating fault.

§

Fold

[a, init, f][acc] — left fold: acc starts at init and becomes f(acc, x) for each element in iteration order. f: fn(U, T): U.

§

FilterMap

[a, f][a'] — the Option-mapper: f(x) for each element, kept unwrapped when some(v), dropped when none, in iteration order. f: fn(T): Option[U]; a non-Option return is a turn-terminating fault. Still pure·silent-required — the natural companion of map under the §1.4 Option ruling, not a relaxation.

§

Each

[a, f][null] — the effectful “do something per element, no result” spelling: f(x) runs for each element, in iteration order, for its side effects; the return value is discarded. f: fn(T). Effectful: writes and emitted output are legal.

§

MapEach

[a, f][a'] — the effectful transform: the array of f(x) for each element, in iteration order, sequential and never fused; f may write/emit. f: fn(T): U. map’s ugly, honest twin.

Implementations§

Source§

impl SeqVerbOp

Source

pub const ALL: [SeqVerbOp; 6]

Every fn-value verb, in kind-byte order (tests + tooling).

Source

pub fn mnemonic(self) -> &'static str

The source spelling of this verb — also the .inkt mnemonic and the program_model disassembly text, and the verb name runtime faults report. Stable, boring, snake_case.

Source

pub fn is_effectful(self) -> bool

Whether this verb’s callback runs under the pure·silent contract (E119-gated, output captured, dev-mode world-write guard armed) or the effectful contract (each/map_each: output reaches the transcript, writes are legal). The VM’s seq_map/seq_filter/ seq_fold/seq_filter_map/seq_each/seq_map_each each read this directly when entering their callback scope (enter_callback_scope(flow, VERB, op.is_effectful())), so it single-sources the classification guard_comparator_write’s posture ultimately keys off — there is exactly one place a new SeqVerbOp variant’s pure/effectful contract can be gotten wrong.

Source

pub fn from_mnemonic(s: &str) -> Option<Self>

Inverse of mnemonic for the .inkt reader.

Trait Implementations§

Source§

impl Clone for SeqVerbOp

Source§

fn clone(&self) -> SeqVerbOp

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SeqVerbOp

Source§

impl Debug for SeqVerbOp

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SeqVerbOp

Source§

impl Hash for SeqVerbOp

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for SeqVerbOp

Source§

fn eq(&self, other: &SeqVerbOp) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SeqVerbOp

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.