Named native binary-indexed list access #
This module retains a single-pass scan of a standard framed list with a binary countdown. The scan keeps the remaining binary index and an optional selected value, processes every encoded occurrence, and returns an explicit default when the index is out of range.
Main definitions #
Turing.MultiTapeTM.Internal.NativeCompiler.listGetDNatCompiler: total binary-indexed lookup.Turing.MultiTapeTM.Internal.NativeCompiler.listGet?NatCompiler: optional binary-indexed lookup.Turing.MultiTapeTM.Internal.NativeCompiler.listMapCompiler: retained standard-list mapping.Turing.MultiTapeTM.Internal.NativeCompiler.listReplaceUnaryCompiler: retained unary-indexed replacement with out-of-range lists unchanged.Turing.MultiTapeTM.Internal.NativeCompiler.listConsCompiler,.listTailCompiler: retained standard-list constructor and tail.Turing.MultiTapeTM.Internal.NativeCompiler.listAppendCompiler,.optionToListCompiler: retained standard-list concatenation and optional singleton conversion.Turing.MultiTapeTM.Internal.NativeCompiler.listZipWithLeftCompiler: retained left-length zip with an explicit default for a short right list.Turing.MultiTapeTM.Internal.NativeCompiler.listGetNatStreamCompiler: the retained scan before input marshalling.
Main results #
Turing.MultiTapeTM.Internal.NativeCompiler.time_listGetDNatCompiler: separates marshalling, scan, intermediate-copy and composition costs.Turing.MultiTapeTM.Internal.NativeCompiler.listBits_le_time_listGetDNatCompiler: every framed list occurrence is charged by the complete lookup clock.
Retained standard-list tail, dropping exactly the first framed occurrence when present.
Retained standard-list constructor, framing the new head and appending the encoded tail.
Retained standard-list append. Both encoded lists are emitted once, without another framing layer around either list.
Retained conversion of an option to its zero-or-one-element standard list.
State for binary-indexed access: the remaining index and an optional prior selection.
Advance the binary countdown, retaining the first value selected at remaining index zero.
Return a selected value, or the explicit default if the index was out of range.
The completed countdown scan implements total list access.
Retained per-occurrence state callback for binary-indexed list access.
A list scan emits no per-occurrence output; selection remains in the stream state.
Retained final selection/default callback.
Explicit peak lifted-callback workspace over the actual list scan.
Explicit peak lifted-callback workspace for optional binary-indexed access.
Explicit peak encoded state/element length over the actual list scan.
Retained binary-countdown scan before list/index input marshalling.
Retained binary-countdown scan returning none exactly for an out-of-range index.
Retained marshalling from (list, binary index) to countdown stream state.
Optional binary-indexed standard-list access, including marshalling and every scanned entry.
Total binary-indexed standard-list access, including marshalling and every scanned entry.
Every encoded list occurrence is charged by the binary-indexed scan.
Standard-list map #
Apply and frame the named element compiler for one list-map occurrence.
List-map finalization emits no additional bits.
Explicit peak lifted-callback workspace over the actual list-map rounds.
Retained list-map scan before input marshalling.
Retained marshalling from a standard list to the unit-state stream layout.
Retained standard-list map, including marshalling and every element callback.
Every encoded input occurrence is charged by the retained list map.
Left-length zip #
Apply and frame the named zip callback for one left-list occurrence.
Left-length zip finalization emits no additional bits.
Explicit peak callback workspace over the actual left-length zip rounds.
Retained left-length zip scan before input reordering.
Retained left-length zip, including the charged input reordering pass.
Unary-indexed replacement #
Control state for unary-indexed list replacement.
Update the unary countdown after emitting one list element.
Emit the replacement at the selected occurrence and the original element elsewhere.
Once replacement is complete, the stream emits each remaining element unchanged.
The replacement stream agrees with List.modify; an out-of-range index changes nothing.
Retained per-occurrence state update for unary-indexed replacement.
Retained per-occurrence emitter for unary-indexed replacement.
Replacement finalization emits no extra bits.
Explicit peak lifted-callback workspace over the actual replacement scan.
Explicit peak encoded state/element length over the actual replacement scan.
Retained unary-indexed replacement scan before input marshalling.
Retained marshalling from (list, unary index, replacement) to replacement stream state.
Unary-indexed replacement, including marshalling and a full charged list scan.
Every input occurrence is charged even when the replacement index is out of range.