107. Collapse std.prefix to one prefix(a) / Prefix and one Diff family (2026-11-21)
- Decision. Collapse
prefix1/prefix2/prefix_nandPrefix1/Prefix2/PrefixNinto oneprefix(a)constructor and one user-visiblePrefixtype family dispatching by shape across[D]T(Prefix<D, T>),[R, C]T(Prefix<R, C, T>), andList<T>/[0..n]T(Prefix<T>). Every shape exposes O(1).sum(range...)and O(1).prefix(bound...)(adding.prefix(r, c)on 2-D grids) with build/query costs documented. CollapseDiff1<D, T>andDiff2<R, C, T>into oneDifffamily (Diff<D, T>()andDiff<R, C, T>()). Internal specializations (_Prefix2,_PrefixList,_Diff2) stay hidden fromcpl-docand display asPrefix/Diff.stdlib/prelude.cpexportsuse std.prefix.{Diff, Prefix}(net -2 prelude names). The removed arity-suffixed names (prefix1,prefix2,prefix_n,Prefix1,Prefix2,PrefixN,Diff1,Diff2) are compile errors with machine-applicable fixes incpl-checkandcpl fix(L0513), and all live ports, dreams, tests, editor data, and docs are migrated. - Reason. One spelling per idea: prefix sums and difference arrays are one concept parameterized by shape, not three or two separately named APIs by arity.
- Reverse. Restore
Prefix1/Prefix2/PrefixN/prefix1/prefix2/prefix_n/Diff1/Diff2instdlib/prefix.cpandstdlib/prelude.cp, removeprefix_shape_struct/INTERNAL_BUILT_ONdispatch incpl-check/cpl-ir, and revertL0513to warning-only call rewrites.