Design decisions

67. IntervalMap.assign zero-alloc on_old: callback (2026-11-21)

  1. IntervalMap.assign(mut self, r: Range<D>, val: T, on_old: (Range<D>, T) -> () = (_, _) => ()) reports overwritten runs via an optional callback instead of returning a List or -> yields. Reason: cpl_ir::pushed::Feeds intentionally does not push -> yields on mut self methods (an early break could leave the partition half-mutated), whereas a callback parameter both enforces partition completion and devirtualizes to an inlined template functor in C++ with zero heap allocation. Combined with a single-run fast path, cf2237h dropped from 1.66s to 1.26s on max binary-tree input and IntervalMap runs at 1.15x matched C++ std::map ODT (0.15s vs 0.13s). Reverse: change assign back to return List<(range: Range<D>, val: T)> in stdlib/interval.cp and restore for (r, t) in paint.assign(...) in proto/ports/ecnerwala/cf2237h.cp.