ocaml: phase 6 Map/Set extensions iter/fold/filter/union/inter (+4 tests, 422 total)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 32s

Map.Make: iter, fold, map, filter, is_empty added.
Set.Make: iter, fold, filter, is_empty, union, inter added.

All written in OCaml inside the existing functor bodies. Tested:
  IntMap.fold (fun k v acc -> acc + v) m 0           = 30
  IntSet.elements (IntSet.union {1,2} {2,3})         = [1; 2; 3]
  IntSet.elements (IntSet.inter {1,2,3} {2,3,4})     = [2; 3]
This commit is contained in:
2026-05-08 16:02:45 +00:00
parent b297c83b1d
commit 404c908a9a
3 changed files with 75 additions and 0 deletions

View File

@@ -386,6 +386,9 @@ the "mother tongue" closure: OCaml → SX → OCaml. This means:
_Newest first._
- 2026-05-08 Phase 6 — Map/Set extensions: iter/fold/map/filter/
is_empty + Set.union/inter (+4 tests, 422 total). Functor
bodies grow naturally — all in OCaml syntax.
- 2026-05-08 Phase 6 — `Map.Make` / `Set.Make` functors written in
OCaml (+4 tests, 418 total). Sorted association list / sorted list
backed (linear ops, but correct). Both take an `Ord` module supplying