Changelog
View SourceAll 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.configstate 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/2is 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 andproofs/LAWS.md. - The proofs build without Lean warnings.
- Every function's docs include a shell example, checked by
ct_docteston 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,3andsplitrebuild 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_listis about 5.9x faster,reverse2.0x,filter1.7x,sublist2.8x andsplit2.3x.duplicate/2shares the same spine-size function. Results, laws and exceptions are unchanged, and the proofs still run on upstream Lynx0126a98.sublist/2,3andsplit/2push 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/2rebuilds 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 lawszip_matches_lists,zip_raises_like_listsandzip_preserves_valid.unzip/1, keeping both tree shapes, with lawsunzip_matches_lists,unzip_raises_like_listsandunzip_preserves_valid. A non-pair element raisesfunction_clause, aslists:unzip/1does.mapfoldl/3andmapfoldr/3, keeping the tree shapes, with six laws and the lemmasmapfoldl_agreesandmapfoldr_agreesfor every deterministic fun. A non-pair result raises{badmatch, V}, aslistsdoes. A ninth sample fun,sample_pair2/2, returns a pair so the laws cover success.skew_list_bench:run_tier4/0, andscripts/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:splitis 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 lawslast_matches_listsandlast_raises_like_lists.member/2, with lawmember_matches_lists.all/2andany/2, stopping at the first decisive element, with lawsall_matches_lists,all_raises_like_lists,any_matches_listsandany_raises_like_lists, and the lemmasall_agreesandany_agreesfor every deterministic predicate. A non-boolean result raises{case_clause, V}, aslistsdoes.sublist/2,sublist/3andsplit/2, O(taken + log n), with nine laws (matches,raises_likeandpreserves_valideach; thesublist/3laws end in_at).duplicate/2, O(log n) time and memory by sharing equal subtrees, with lawsduplicate_matches_lists,duplicate_raises_like_listsandduplicate_preserves_valid. The proofs show the greedy spine is the canonical one. Its integer recursion, and that of thelistshelperduplicate/3, is translated withpartial_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
listsclauses the laws compare against are identical on 27.3.4.20, 28.5.0.5 and 29.1.3.skew_list.beamMD5 on the new pin:3919c397a2b6e6603d4317629130094e.The law-coverage check in
proofs/verify.exsalso matches a law's argument count to the export's arity, sosublist/2andsublist/3are covered separately.scripts/pinnedalso resetsMIX_HOMEandMIX_ARCHIVES, somixloads the pinned Elixir's own Hex.Invalid arguments now fail by clause mismatch instead of an explicit
erlang:error(function_clause). The exception is stillerror: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, andreverse_onto/2in place of the locallists_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 lawsreverse_matches_listsandreverse_preserves_valid.append/2, with lawsappend_matches_listsandappend_preserves_valid.foldl/3, with lawsfoldl_matches_listsandfoldl_raises_like_lists, and the lemmafoldl_agrees: for every deterministic fun,foldl/3returns or raises exactly whatlists:foldl/3does.foldr/3, with lawsfoldr_matches_listsandfoldr_raises_like_lists, and the lemmafoldr_agrees, the same guarantee againstlists:foldr/3.map/2, with lawsmap_matches_lists,map_raises_like_listsandmap_preserves_valid, and the lemmamap_agreesfor every deterministic fun.mapkeeps the tree shapes.filter/2, with lawsfilter_matches_lists,filter_raises_like_listsandfilter_preserves_valid, and the lemmafilter_agreesfor every deterministic predicate. A non-boolean result raises{bad_filter, V}, aslists:filter/2does on OTP 27.3.4.20.skew_list_bench:run_tier2/0, benchmarking the six functions against the route throughlists.
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 lawsnew_matches_listandnew_preserves_valid.cons/2,hd/1,tl/1,length/1,to_list/1,from_list/1, with 16 verified laws, includingequal_iff_elements_equal(=:=on skew lists is element-wise=:=).nth/2andupdate/3(O(log n)), with 6 verified laws. Out-of-range or non-integer positions raisefunction_clause, aslists:nth/2does on OTP 27.3.4.20.nthtail/2(O(log n)), with 3 verified laws. Its result is exactly whatNcalls oftl/1give, so it is canonical.