Files
rose-ash/lib
giles 98ba772acd
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 24s
ocaml: phase 6 List.equal / List.compare (+5 tests, 589 total)
Both take an inner predicate / comparator and walk both lists in
lockstep:

  equal eq a b     short-circuits on first mismatch
  compare cmp a b  -1 if a is a strict prefix
                    1 if b is
                    0 if both empty
                    otherwise first non-zero element comparison

Mirrors real OCaml's signatures.

  List.equal (=) [1;2;3] [1;2;3]            = true
  List.equal (=) [1;2;3] [1;2;4]            = false
  List.compare compare [1;2;3] [1;2;4]      = -1
  List.compare compare [1;2] [1;2;3]        = -1
  List.compare compare [] []                = 0
2026-05-09 06:35:42 +00:00
..