Files
rose-ash/lib/ocaml/baseline
giles 7c40506571
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 23s
ocaml: phase 5.1 merge_sort.ml baseline (user mergesort, sum=44)
User-implemented mergesort that exercises features added across the
last few iterations:

  let rec split lst = match lst with
    | x :: y :: rest ->
      let (a, b) = split rest in       (* iter 98 let-tuple destruct *)
      (x :: a, y :: b)
    | ...

  let rec merge xs ys = match xs with
    | x :: xs' ->
      match ys with                     (* nested match-in-match *)
      | y :: ys' -> ...

  ...

  List.fold_left (+) 0 (sort [...])     (* iter 89 (op) section *)

Sum of [3;1;4;1;5;9;2;6;5;3;5] = 44 regardless of order, so the
result is also a smoke test of the implementation correctness — if
merge_sort drops or duplicates an element the sum diverges. 26
baseline programs total.
2026-05-09 05:00:50 +00:00
..