Design decisions

3. Abstraction mechanisms

#DecisionStatusCurrent leanDepends onWhere
3.1Traits vs operation valuesRevised 2026-11-20 (v2)Bare operators (+, *, ^, &, |, min, max, gcd), (id, op) pairs, desc(x), and Action (for LazySegTree); contestant algebraic wrapper zoo (Sum/Max/Order/Semiring/etc.) deleted§16, research/archive/audits/subtraction-audit-1.md Cut 15
3.2SpecializationSettledper type and per fn identity; runtime-chosen code is an errorplan/13-abstraction.md M3
3.3dyn escape hatchDeleted 2026-11-20 (v2)Removed from the language (0 uses across 299 ports); static specialization only3.2§16, research/archive/audits/subtraction-audit-1.md Cut 9
3.4LawsSettleddeclared on operation types, checked by cpl test and debug runsplan/13-abstraction.md M4
3.5Core & library traits (7 + 2)Revised 2026-11-20 (v2.2)7 core auto-derived traits (Index, Seq, Eq, Ord, Hash, Show, Read; Copy internalized into compiler value semantics) + 2 library-author traits (Indexed unified with IndexedMut, and Iterable; Gen dropped). Internal stdlib hooks (Reversible, Neighbours, Target) remain normal library traits outside the core§16, §19.2, research/archive/architecture/language-architecture-v2.2.md
3.6Implicit representation choicesSettledonly when no worse on any op or memory, and visible (G9)plan/00-vision.md G9
3.7Structural field boundsLeaningA has to: V as a general feature, not graph-specificplan/13-abstraction.md G9
3.8Associated types, consts and frozen letsSettled 2026-11-20yes. Associated types (Indexed.Elem, Seq.bounds). An associated size is const K = 10 when known at compile time and let K = n when frozen from a run-time value where the impl is declared; const K = n with a run-time n is an error, so const stays strictly compile-time (7.10). Sizing by a var is an error7.10plan/19-index-and-lends.md §3.1
3.9Coherence (who may impl what)Settled 2026-11-19orphan rule relaxed inside one program, strict for libraries6.4§8
3.10Mod<P> (unified moduli)Revised 2026-11-20 (v2.2)One Mod<P> type accepting both const and runtime-frozen let Int moduli via 3.8 (ModR retired). Works for any P >= 1 (incl. composite; .try_inv() -> ?Z); 4-byte uint32_t when P <= 2^31 - 1, I128 widen above; one-way Int reduction; constant-divisor inverse lowering; T.zero-seeded sum; immutable let comb = Comb<P>() with interior-mutability lazy growth3.8§16, §17.5, §18.7, §19.10
3.11Decorators (@)Revised 2026-11-20 (v2.2)User-defined decorator macros deleted. 8 contestant decorators (@memo, @multitest, @brute, @tags, @gen, @checker, @interactor, @grader) + 3 library-author (@get, @test, @law replacing hard keyword law). Parameter grammars @memo(flat|hash), @multitest(count:), and @grader const deleted. 0.2.2: the test-case divider is the file-level directive @!multitest (§20), not a decorator; @ always decorates the one item below it§16, §19.1, §19.3, §20