package ucharset
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Character classes for Unicode-aware lexers and regex engines
Install
dune-project
Dependency
Authors
Maintainers
Sources
ucharset-0.2.1.tbz
sha256=d63ee03f167eb6f6e3b3198f4691ec7668836de0316d6e46ba078a42b75ca342
sha512=1d0bd0ceda50c94f9df140f29f6aa7c433e7baa41ce43573d5e31c48479c4af29c9683c5c4a9a9a2df3f840887cd11141304b1b5a6343c6e24d62878588ee506
doc/CHANGES.html
v0.2.1 (2026-10-05)
Performance
Partition.meetcould slow to a crawl when one partition had many blocks inside a single block of the other: 4 seconds where it should take a few milliseconds. Its lookup table now spreads those cases evenly.unionreturns the larger set itself, rather than a copy, when one set contains the other and they start at the same codepoint.
Packaging
- Needs dune 3.0 or later, down from 3.20.
v0.2.0 (2026-09-03)
Breaking
- 64-bit only.
Builder.buildpacks two 21-bit endpoints into oneintwhile sorting, so the module now fails at load time on a narrowerintrather than returning corrupted sets, and the package is unavailable on 32-bit architectures. Lookup.mem_charis gone. It read a byte from0x80up as Latin-1, whereascii_tablereads the same byte as UTF-8, so the two disagreed on half the table. UseLookup.mem_ucharon the decoded scalar, orascii_tableon the raw byte.Partition.block_ofis nowPartition.block_of_opt, answeringNonewhere it returned-1.Partition.of_blocksnumbers blocks by least element rather than by position in the list, soPartition.of_set sleads with whichever ofsandcomp sholds codepoint0.hashmixes the endpoint count, so sets hash differently from v0.1.0.emptyandsingleton 0no longer both hash to0.to_string,to_hex_stringandto_class_stringreturn one line whatever the set's width. Theppfamily still breaks at the formatter's margin.Invalid_argumentmessages nameUcharset, not theCharsetmodule that never existed.to_listis nowto_intervals. It returns runs, not codepoints, so it never paired withof_list;of_intervalsis its inverse.pp_classandto_class_stringescape the non-ASCII whitespace as well (U+00A0,U+1680,U+2000toU+200A,U+2028,U+2029,U+202F,U+205F,U+3000), which used to print as themselves and read as the separator between members.
Added
Partition.block_of_opt: which block holds a codepoint, without building a block.Lookup.mem_uchar.
Performance
meet_allrefines pairwise by halving instead of sweeping every input at once. Faster as the number of partitions grows, at 8x to 13x the allocation.Partition.meetsizes its scratch tables by block count, not segment count.subsetgallops likedisjointrather than walkingof_linearly.mem,subset,equal,compareandPartition.block_of_optallocate nothing per call.minis monomorphic again in the sort and gallop paths.xoris one merge over the endpoints rather thanunion (diff a b) (diff b a), so one array where there were three.union_listof exactly two sets callsuniondirectly, asinter_listalready did.mapsizes its accumulator fromcardinal, the exact number of pairs it will emit.inter_listfinds the overlap and the exhausted inputs in one pass rather than two.
Documentation
- The module preamble carries the validation contract again: functions building or updating a set from a raw
intraise on a surrogate or an out-of-range value, queries answer for anyint. of_packed_stringdocuments acceptance as exactly whatto_packed_stringemits, adjacent intervals included. The encoding itself is unchanged since v0.1.0.- The
Lookupfootprint and "branch-free" claims are corrected: only the leaf pool scales with the set, and the index scales with the largest member. - Doc comments for the values that had none.
xorno longer claims to be the only operation allocating more than one array, which was false forrefine,of_blocks,to_lookupandmeet_all.meet_allstates its cost again: O(S log k) against foldingmeetat O(S k).filterdocuments that it cannot size its accumulator in advance, andPartition.blockthat building every block one at a time is whatblocksis for.
v0.1.0
- Initial release.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page