Skip to content
Open Saka

pos

Positions that keep items in a chosen order, such as the rows of a list: a new position comes from its neighbors, and existing positions never change. Equal inputs give equal positions. Duplicate positions are legal; use current neighbors when inserting rather than repeatedly using the neutral value.

Write these names after pos::, as in pos::between.

between

def between(lower? pos, upper? pos)! pos

Returns a deterministic position strictly between the supplied bounds. An empty Bag means no bound; equal or reversed bounds fail with Conflict. With no bounds, returns neutral. Equal arguments give equal results, not fresh identities.

many

proc many(count! num, lower? pos, upper? pos)* num -> pos

Allocates count strictly increasing positions within the optional bounds as index -> position. Indices are consecutive from zero, with multiplicity one; they do not order Bag enumeration. The count must be a finite nonnegative integer. Invalid counts or bounds fail with Conflict. Zero count still validates bounds. Counts exceeding the Bag-total limit also fail with Conflict. Returns exactly count entries on success; zero count returns the typed empty Map Bag. The numeric count is not a cardinality parameter or a dependent return type. Results are deterministic and distinct within the call. Work limits use ordinary LimitExceeded failures without publishing partial results.

neutral

def neutral! pos

The deterministic unbounded logical key 7F, serialized as Uk. Reusing it does not create distinct placements.

before

def before(upper? pos)! pos

Returns a position strictly before the bound; an empty bound produces neutral.

after

def after(lower? pos)! pos

Returns a position strictly after the bound; an empty bound produces neutral. For append operations, pos::after(max(items.k)) also handles an empty collection.