Changelog

View Source

All notable changes are listed here, in the format of Keep a Changelog. Each release lists the exports added, the toolchain its laws were verified on, and any exception value that changed on a pin bump.

[Unreleased]

[1.0.1] - 2026-11-29

No code change; skew_list.beam MD5 6a761aaf2d4f962af6b5df765f86dbbe, as in 1.0.0.

Changed

  • The README, module docs and rebar.config state that OTP 27 or later is required (the docs use triple-quoted and ~"..." strings). On OTP 26 rebar3 now stops with "OTP release 27 or later is required by skew_list" instead of syntax errors.

[1.0.0] - 2026-11-29

The first published release. The API is stable: the 28 exports and their laws are those of 0.5.0, and later releases follow semantic versioning.

Verified on OTP 29.1.3, Elixir 1.20.5, Lynx 0126a98, Lean 4.36.0; skew_list.beam MD5 6a761aaf2d4f962af6b5df765f86dbbe. 73 laws.

Changed

  • append/2 is documented as O(length(S1)) in both of its branches.
  • The README is shorter; the full benchmark tables are in bench/RESULTS.md, and the docs and package include it and proofs/LAWS.md.
  • The proofs build without Lean warnings.
  • Every function's docs include a shell example, checked by ct_doctest on OTP 29, and the functions are grouped on hexdocs.

[0.5.0] - 2026-11-29 (local, not published)

Verified on OTP 29.1.3, Elixir 1.20.5, Lynx 0126a98, Lean 4.36.0; skew_list.beam MD5 6a761aaf2d4f962af6b5df765f86dbbe. 73 laws. The README benchmarks now run on an Intel Core i9-14900KF (Linux) rather than Apple silicon; the speedups below were measured on Apple silicon.

Changed

  • from_list, reverse, filter, sublist/2,3 and split rebuild in one pass: the canonical spine sizes for the length are known, so each tree is filled in preorder straight from the element list, with sizes 3, 7 and 15 written out. Against 0.4.0 at 1M elements, from_list is about 5.9x faster, reverse 2.0x, filter 1.7x, sublist 2.8x and split 2.3x. duplicate/2 shares the same spine-size function. Results, laws and exceptions are unchanged, and the proofs still run on upstream Lynx 0126a98.
  • sublist/2,3 and split/2 push subtrees they take whole without counting each element, allocating 2.2 rather than 2.9 words per element; about 1.2–1.9x faster on long prefixes.
  • append/2 rebuilds both lists in one pass when the second is no longer than the first, instead of consing the first list's elements onto the second: 1.2 to 4.3 times faster in that case on the i9, and unchanged otherwise.

[0.4.0] - 2026-11-28 (local, not published)

Verified on OTP 29.1.3, Elixir 1.20.5, Lynx 0126a98, Lean 4.36.0; skew_list.beam MD5 32559f56df5708aa3d18a41d970997f5. 73 laws.

Added

  • zip/2, pairing trees directly (equal lengths have equal shapes), with laws zip_matches_lists, zip_raises_like_lists and zip_preserves_valid.
  • unzip/1, keeping both tree shapes, with laws unzip_matches_lists, unzip_raises_like_lists and unzip_preserves_valid. A non-pair element raises function_clause, as lists:unzip/1 does.
  • mapfoldl/3 and mapfoldr/3, keeping the tree shapes, with six laws and the lemmas mapfoldl_agrees and mapfoldr_agrees for every deterministic fun. A non-pair result raises {badmatch, V}, as lists does. A ninth sample fun, sample_pair2/2, returns a pair so the laws cover success.
  • skew_list_bench:run_tier4/0, and scripts/check, which runs the whole suite (tests, lint, proofs in parallel) in about 15 seconds.

Changed

  • Rebuilding (from_list, reverse, append, filter, sublist, split) conses onto the bare spine and builds the record once: split is about 1.6x faster at 65k elements; at 1M the gain is within the benchmark's noise.

[0.3.0] - 2026-11-28 (local, not published)

Verified on OTP 29.1.3, Elixir 1.20.5, Lynx 0126a98, Lean 4.36.0; skew_list.beam MD5 753e6b2f5fbcf05242eb5f96cf956337. 61 laws.

Added

  • last/1, O(log n), with laws last_matches_lists and last_raises_like_lists.
  • member/2, with law member_matches_lists.
  • all/2 and any/2, stopping at the first decisive element, with laws all_matches_lists, all_raises_like_lists, any_matches_lists and any_raises_like_lists, and the lemmas all_agrees and any_agrees for every deterministic predicate. A non-boolean result raises {case_clause, V}, as lists does.
  • sublist/2, sublist/3 and split/2, O(taken + log n), with nine laws (matches, raises_like and preserves_valid each; the sublist/3 laws end in _at).
  • duplicate/2, O(log n) time and memory by sharing equal subtrees, with laws duplicate_matches_lists, duplicate_raises_like_lists and duplicate_preserves_valid. The proofs show the greedy spine is the canonical one. Its integer recursion, and that of the lists helper duplicate/3, is translated with partial_fixpoint; the proofs show every call returns.
  • skew_list_bench:run_tier3/0, benchmarking the Tier 3 functions against the same operation on a plain list.

Changed

  • Pinned toolchain moved to OTP 29.1.3 and Elixir 1.20.5 (from OTP 27.3.4.20 and Elixir 1.18.6). All 42 laws re-verify with no proof changes, and no exception value changed: the lists clauses the laws compare against are identical on 27.3.4.20, 28.5.0.5 and 29.1.3. skew_list.beam MD5 on the new pin: 3919c397a2b6e6603d4317629130094e.

  • The law-coverage check in proofs/verify.exs also matches a law's argument count to the export's arity, so sublist/2 and sublist/3 are covered separately.

  • scripts/pinned also resets MIX_HOME and MIX_ARCHIVES, so mix loads the pinned Elixir's own Hex.

  • Invalid arguments now fail by clause mismatch instead of an explicit erlang:error(function_clause). The exception is still error:function_clause, but the stacktrace now shows the actual arguments.

  • Internal clean-ups with no change in results: clause guards instead of boolean case, #skew_list{} patterns, and reverse_onto/2 in place of the local lists_reverse/2.

[0.2.0] - 2026-11-28 (local, not published)

Verified on OTP 27.3.4.20, Elixir 1.18.6, Lynx 0126a98, Lean 4.36.0; skew_list.beam MD5 44b0e21862b826e8943ae5f08e3048e6. 42 laws.

Added

  • reverse/1, with laws reverse_matches_lists and reverse_preserves_valid.
  • append/2, with laws append_matches_lists and append_preserves_valid.
  • foldl/3, with laws foldl_matches_lists and foldl_raises_like_lists, and the lemma foldl_agrees: for every deterministic fun, foldl/3 returns or raises exactly what lists:foldl/3 does.
  • foldr/3, with laws foldr_matches_lists and foldr_raises_like_lists, and the lemma foldr_agrees, the same guarantee against lists:foldr/3.
  • map/2, with laws map_matches_lists, map_raises_like_lists and map_preserves_valid, and the lemma map_agrees for every deterministic fun. map keeps the tree shapes.
  • filter/2, with laws filter_matches_lists, filter_raises_like_lists and filter_preserves_valid, and the lemma filter_agrees for every deterministic predicate. A non-boolean result raises {bad_filter, V}, as lists:filter/2 does on OTP 27.3.4.20.
  • skew_list_bench:run_tier2/0, benchmarking the six functions against the route through lists.

Changed

  • The {skew_list, Len, Trees} term is written as a private record. The term, its shape and every exception are unchanged.

[0.1.0] - 2026-11-28 (local, not published)

Verified on OTP 27.3.4.20, Elixir 1.18.6, Lynx 0126a98, Lean 4.36.0; skew_list.beam MD5 3aa27e8969842f074d3cd771b7501f0e.

Added

  • new/0, with laws new_matches_list and new_preserves_valid.
  • cons/2, hd/1, tl/1, length/1, to_list/1, from_list/1, with 16 verified laws, including equal_iff_elements_equal (=:= on skew lists is element-wise =:=).
  • nth/2 and update/3 (O(log n)), with 6 verified laws. Out-of-range or non-integer positions raise function_clause, as lists:nth/2 does on OTP 27.3.4.20.
  • nthtail/2 (O(log n)), with 3 verified laws. Its result is exactly what N calls of tl/1 give, so it is canonical.