Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
0.2.0 Preview 1 · Frozen documentation

BinaryCallable

Defines a safe readonly reducer with an exact Copy/reference accumulator.

Sn is under heavy development. Reference extracted from this release’s bundled standard library. Public API examples are not an exhaustive compatibility test. Read the matching release guide for tested workflows and limitations. Read the status →

Module std.iteration

import std.iteration;

Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.

BinaryCallable

pub concept BinaryCallable<Self, A, T, R>

Defines a safe readonly reducer with an exact Copy/reference accumulator.

Authored objects supply public readonly Invoke; generated capturing lambdas use the authenticated canonical witness. No callback box or allocation is introduced. Concrete capture lifecycle remains ordinary; borrowed captures must survive every invocation. External synchronization is required whenever callback backing is shared with writers. Exact modes and safety are preserved. Self: Concrete callback/environment type. A: Accumulator type with its exact ownership/access category. T: Exact input item value/reference type. R: Exact result type and reference access. Warning: Does not extend borrowed backing lifetime or erase unsafe authorization.

BinaryCallable.Invoke

requires readonly fn Invoke(Accumulator: A, Item: T) -> R;

Reduces one item through safe readonly environment access. Accumulator: Previous state; follows the declared passing mode. Item: Exact input item; owning payloads transfer, references alias. Return: Exact replacement; borrowed results retain their validity boundary.

Documentation snapshot: October 24, 2026 About versions ↗
Searching Development · language & standard library